Skip to content

Commit a582e96

Browse files
committed
only erase param env regions where needed
1 parent 5725355 commit a582e96

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/rustc_middle/src/ty/util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ impl<'tcx> Ty<'tcx> {
11071107
// This doesn't depend on regions, so try to minimize distinct
11081108
// query keys used.
11091109
// If normalization fails, we just use `query_ty`.
1110-
let param_env = tcx.erase_regions(param_env);
1110+
debug_assert!(!param_env.has_infer());
11111111
let query_ty = tcx
11121112
.try_normalize_erasing_regions(param_env, query_ty)
11131113
.unwrap_or_else(|_| tcx.erase_regions(query_ty));

compiler/rustc_trait_selection/src/traits/query/dropck_outlives.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ pub fn dtorck_constraint_for_ty_inner<'tcx>(
298298
// While we conservatively assume that all coroutines require drop
299299
// to avoid query cycles during MIR building, we can check the actual
300300
// witness during borrowck to avoid unnecessary liveness constraints.
301-
if args.witness().needs_drop(tcx, param_env) {
301+
if args.witness().needs_drop(tcx, tcx.erase_regions(param_env)) {
302302
constraints.outlives.extend(args.upvar_tys().iter().map(ty::GenericArg::from));
303303
constraints.outlives.push(args.resume_ty().into());
304304
}

0 commit comments

Comments
 (0)