File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
compiler/rustc_borrowck/src Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ use std::rc::Rc;
1212use crate :: borrow_set:: BorrowSet ;
1313
1414pub use super :: {
15+ constraints:: OutlivesConstraint ,
1516 dataflow:: { calculate_borrows_out_of_scope_at_location, BorrowIndex , Borrows } ,
1617 facts:: { AllFacts as PoloniusInput , RustcFacts } ,
1718 location:: { LocationTable , RichLocation } ,
Original file line number Diff line number Diff line change @@ -585,6 +585,11 @@ impl<'tcx> RegionInferenceContext<'tcx> {
585585 self . universal_regions . to_region_vid ( r)
586586 }
587587
588+ /// Returns an iterator over all the outlives constraints.
589+ pub fn outlives_constraints ( & self ) -> impl Iterator < Item = OutlivesConstraint < ' tcx > > + ' _ {
590+ self . constraints . outlives ( ) . iter ( ) . copied ( )
591+ }
592+
588593 /// Adds annotations for `#[rustc_regions]`; see `UniversalRegions::annotate`.
589594 pub ( crate ) fn annotate ( & self , tcx : TyCtxt < ' tcx > , err : & mut Diagnostic ) {
590595 self . universal_regions . annotate ( tcx, err)
@@ -698,7 +703,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
698703 #[ instrument( skip( self , _body) , level = "debug" ) ]
699704 fn propagate_constraints ( & mut self , _body : & Body < ' tcx > ) {
700705 debug ! ( "constraints={:#?}" , {
701- let mut constraints: Vec <_> = self . constraints . outlives ( ) . iter ( ) . collect( ) ;
706+ let mut constraints: Vec <_> = self . outlives_constraints ( ) . collect( ) ;
702707 constraints. sort_by_key( |c| ( c. sup, c. sub) ) ;
703708 constraints
704709 . into_iter( )
You can’t perform that action at this time.
0 commit comments