Skip to content

Commit 651ec4b

Browse files
committed
add comment
1 parent c3cad7d commit 651ec4b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

crates/hir-ty/src/next_solver/mapping.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,6 +1148,13 @@ pub(crate) fn convert_ty_for_result<'db>(interner: DbInterner<'db>, ty: Ty<'db>)
11481148
}),
11491149
);
11501150

1151+
// Rust and chalk have slightly different
1152+
// representation for trait objects.
1153+
//
1154+
// Chalk uses `for<T0> for<'a> T0: Trait<'a>` while rustc
1155+
// uses `ExistentialPredicate`s, which do not have a self ty.
1156+
// We need to shift escaping bound vars by 1 to accommodate
1157+
// the newly introduced `for<T0>` binder.
11511158
let p = shift_vars(interner, p, 1);
11521159

11531160
let where_clause = match p.skip_binder() {

0 commit comments

Comments
 (0)