Skip to content

Commit 434c7da

Browse files
committed
only expect lb lt for fn calls in mir typeck
1 parent 8a0cb6a commit 434c7da

File tree

1 file changed

+8
-6
lines changed
  • compiler/rustc_borrowck/src/type_check

1 file changed

+8
-6
lines changed

compiler/rustc_borrowck/src/type_check/mod.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use rustc_infer::infer::outlives::env::RegionBoundPairs;
2020
use rustc_infer::infer::region_constraints::RegionConstraintData;
2121
use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
2222
use rustc_infer::infer::{
23-
InferCtxt, InferOk, LateBoundRegionConversionTime, NllRegionVariableOrigin,
23+
InferCtxt, InferOk, LateBoundRegion, LateBoundRegionConversionTime, NllRegionVariableOrigin,
2424
};
2525
use rustc_middle::mir::tcx::PlaceTy;
2626
use rustc_middle::mir::visit::{NonMutatingUseContext, PlaceContext, Visitor};
@@ -1436,11 +1436,13 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
14361436
return;
14371437
}
14381438
};
1439-
let (sig, map) = self.infcx.replace_bound_vars_with_fresh_vars(
1440-
term.source_info.span,
1441-
LateBoundRegionConversionTime::FnCall,
1442-
sig,
1443-
);
1439+
let (sig, map) = tcx.replace_late_bound_regions(sig, |br| {
1440+
self.infcx.next_region_var(LateBoundRegion(
1441+
term.source_info.span,
1442+
br.kind,
1443+
LateBoundRegionConversionTime::FnCall,
1444+
))
1445+
});
14441446
debug!(?sig);
14451447
let sig = self.normalize(sig, term_location);
14461448
self.check_call_dest(body, term, &sig, *destination, target, term_location);

0 commit comments

Comments
 (0)