Skip to content

Commit e785472

Browse files
committed
Explain what the substs we're creating are
1 parent 83c5028 commit e785472

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/librustc_typeck/check/compare_method.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,6 +1194,15 @@ fn compare_projection_bounds<'tcx>(
11941194

11951195
let param_env = tcx.param_env(impl_ty.def_id);
11961196

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

0 commit comments

Comments
 (0)