@@ -642,7 +642,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
642
642
polonius_output : Option < Rc < PoloniusOutput > > ,
643
643
) -> ( Option < ClosureRegionRequirements < ' tcx > > , RegionErrors < ' tcx > ) {
644
644
let mir_def_id = body. source . def_id ( ) ;
645
- self . propagate_constraints ( body ) ;
645
+ self . propagate_constraints ( ) ;
646
646
647
647
let mut errors_buffer = RegionErrors :: new ( infcx. tcx ) ;
648
648
@@ -653,13 +653,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
653
653
// eagerly.
654
654
let mut outlives_requirements = infcx. tcx . is_typeck_child ( mir_def_id) . then ( Vec :: new) ;
655
655
656
- self . check_type_tests (
657
- infcx,
658
- param_env,
659
- body,
660
- outlives_requirements. as_mut ( ) ,
661
- & mut errors_buffer,
662
- ) ;
656
+ self . check_type_tests ( infcx, param_env, outlives_requirements. as_mut ( ) , & mut errors_buffer) ;
663
657
664
658
// In Polonius mode, the errors about missing universal region relations are in the output
665
659
// and need to be emitted or propagated. Otherwise, we need to check whether the
@@ -695,8 +689,8 @@ impl<'tcx> RegionInferenceContext<'tcx> {
695
689
/// for each region variable until all the constraints are
696
690
/// satisfied. Note that some values may grow **too** large to be
697
691
/// feasible, but we check this later.
698
- #[ instrument( skip( self , _body ) , level = "debug" ) ]
699
- fn propagate_constraints ( & mut self , _body : & Body < ' tcx > ) {
692
+ #[ instrument( skip( self ) , level = "debug" ) ]
693
+ fn propagate_constraints ( & mut self ) {
700
694
debug ! ( "constraints={:#?}" , {
701
695
let mut constraints: Vec <_> = self . constraints. outlives( ) . iter( ) . collect( ) ;
702
696
constraints. sort_by_key( |c| ( c. sup, c. sub) ) ;
@@ -908,7 +902,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
908
902
& self ,
909
903
infcx : & InferCtxt < ' tcx > ,
910
904
param_env : ty:: ParamEnv < ' tcx > ,
911
- body : & Body < ' tcx > ,
912
905
mut propagated_outlives_requirements : Option < & mut Vec < ClosureOutlivesRequirement < ' tcx > > > ,
913
906
errors_buffer : & mut RegionErrors < ' tcx > ,
914
907
) {
@@ -937,7 +930,6 @@ impl<'tcx> RegionInferenceContext<'tcx> {
937
930
if self . try_promote_type_test (
938
931
infcx,
939
932
param_env,
940
- body,
941
933
type_test,
942
934
propagated_outlives_requirements,
943
935
) {
@@ -990,12 +982,15 @@ impl<'tcx> RegionInferenceContext<'tcx> {
990
982
/// The idea then is to lower the `T: 'X` constraint into multiple
991
983
/// bounds -- e.g., if `'X` is the union of two free lifetimes,
992
984
/// `'1` and `'2`, then we would create `T: '1` and `T: '2`.
993
- #[ instrument( level = "debug" , skip( self , infcx, propagated_outlives_requirements) ) ]
985
+ #[ instrument(
986
+ level = "debug" ,
987
+ skip( self , infcx, param_env, propagated_outlives_requirements) ,
988
+ ret
989
+ ) ]
994
990
fn try_promote_type_test (
995
991
& self ,
996
992
infcx : & InferCtxt < ' tcx > ,
997
993
param_env : ty:: ParamEnv < ' tcx > ,
998
- body : & Body < ' tcx > ,
999
994
type_test : & TypeTest < ' tcx > ,
1000
995
propagated_outlives_requirements : & mut Vec < ClosureOutlivesRequirement < ' tcx > > ,
1001
996
) -> bool {
0 commit comments