Skip to content

Commit 5e8c9f4

Browse files
committed
Explain what the substs we're creating are
1 parent db4826d commit 5e8c9f4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/librustc_typeck/check/compare_method.rs

+9
Original file line numberDiff line numberDiff line change
@@ -1198,6 +1198,15 @@ fn compare_projection_bounds<'tcx>(
11981198

11991199
let param_env = tcx.param_env(impl_ty.def_id);
12001200

1201+
// Given
1202+
//
1203+
// impl<A, B> Foo<u32> for (A, B) {
1204+
// type Bar<C> =...
1205+
// }
1206+
//
1207+
// - `impl_substs` would be `[A, B, C]`
1208+
// - `rebased_substs` would be `[(A, B), u32, C]`, combining the substs from
1209+
// the *trait* with the generic associated type parameters.
12011210
let impl_ty_substs = InternalSubsts::identity_for_item(tcx, impl_ty.def_id);
12021211
let rebased_substs =
12031212
impl_ty_substs.rebase_onto(tcx, impl_ty.container.id(), impl_trait_ref.substs);

0 commit comments

Comments
 (0)