Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit 504a0dc

Browse files
committed
1 parent 5a67239 commit 504a0dc

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

rust-toolchain

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# NOTE: Keep in sync with nightly date on README
22
[toolchain]
3-
channel = "nightly-2022-04-20"
3+
channel = "nightly-2022-05-16"
44
components = ["llvm-tools-preview", "rustc-dev"]

src/traverse.rs

+8-12
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ use rustc_middle::{
2828
metadata::ModChild,
2929
ty::{
3030
subst::{InternalSubsts, Subst},
31-
AssocItem, GenericParamDef, GenericParamDefKind, Generics, TraitRef, Ty, TyCtxt, TyKind,
32-
TypeAndMut, Visibility,
31+
AssocItem, EarlyBinder, GenericParamDef, GenericParamDefKind, Generics, TraitRef, Ty,
32+
TyCtxt, TyKind, TypeAndMut, Visibility,
3333
Visibility::Public,
3434
},
3535
};
@@ -970,12 +970,10 @@ fn cmp_types<'tcx>(
970970
} else {
971971
compcx.compute_target_default_substs(target_def_id)
972972
};
973-
let target = target.subst(infcx.tcx, target_substs);
973+
let target = EarlyBinder(target).subst(infcx.tcx, target_substs);
974974

975-
let target_param_env = infcx
976-
.tcx
977-
.param_env(target_def_id)
978-
.subst(infcx.tcx, target_substs);
975+
let target_param_env =
976+
EarlyBinder(infcx.tcx.param_env(target_def_id)).subst(infcx.tcx, target_substs);
979977

980978
if let Some(err) =
981979
compcx.check_type_error(tcx, target_def_id, target_param_env, orig, target)
@@ -1255,10 +1253,8 @@ fn match_inherent_impl<'tcx>(
12551253
.translate_item_type(orig_impl_def_id, infcx.tcx.type_of(orig_impl_def_id));
12561254

12571255
let target_substs = compcx.compute_target_infer_substs(target_item_def_id);
1258-
let target_self = infcx
1259-
.tcx
1260-
.type_of(target_impl_def_id)
1261-
.subst(infcx.tcx, target_substs);
1256+
let target_self =
1257+
EarlyBinder(infcx.tcx.type_of(target_impl_def_id)).subst(infcx.tcx, target_substs);
12621258

12631259
let target_param_env = infcx.tcx.param_env(target_impl_def_id);
12641260

@@ -1316,7 +1312,7 @@ fn match_inherent_impl<'tcx>(
13161312
let orig = compcx
13171313
.forward_trans
13181314
.translate_item_type(orig_item_def_id, orig);
1319-
let target = target.subst(infcx.tcx, target_substs);
1315+
let target = EarlyBinder(target).subst(infcx.tcx, target_substs);
13201316

13211317
let error =
13221318
compcx.check_type_error(tcx, target_item_def_id, target_param_env, orig, target);

0 commit comments

Comments
 (0)