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;
12
12
use crate :: borrow_set:: BorrowSet ;
13
13
14
14
pub use super :: {
15
+ constraints:: OutlivesConstraint ,
15
16
dataflow:: { calculate_borrows_out_of_scope_at_location, BorrowIndex , Borrows } ,
16
17
facts:: { AllFacts as PoloniusInput , RustcFacts } ,
17
18
location:: { LocationTable , RichLocation } ,
Original file line number Diff line number Diff line change @@ -585,6 +585,11 @@ impl<'tcx> RegionInferenceContext<'tcx> {
585
585
self . universal_regions . to_region_vid ( r)
586
586
}
587
587
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
+
588
593
/// Adds annotations for `#[rustc_regions]`; see `UniversalRegions::annotate`.
589
594
pub ( crate ) fn annotate ( & self , tcx : TyCtxt < ' tcx > , err : & mut Diagnostic ) {
590
595
self . universal_regions . annotate ( tcx, err)
@@ -698,7 +703,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
698
703
#[ instrument( skip( self , _body) , level = "debug" ) ]
699
704
fn propagate_constraints ( & mut self , _body : & Body < ' tcx > ) {
700
705
debug ! ( "constraints={:#?}" , {
701
- let mut constraints: Vec <_> = self . constraints . outlives ( ) . iter ( ) . collect( ) ;
706
+ let mut constraints: Vec <_> = self . outlives_constraints ( ) . collect( ) ;
702
707
constraints. sort_by_key( |c| ( c. sup, c. sub) ) ;
703
708
constraints
704
709
. into_iter( )
You can’t perform that action at this time.
0 commit comments