diff options
| author | Michael Goulet <michael@errs.io> | 2025-01-10 04:36:11 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-01-30 15:33:58 +0000 |
| commit | 9f44caa8579d69e829d89ffaae0260c85141fdfc (patch) | |
| tree | 8463312dc0dab688922f2fc80739cdeab04e7537 | |
| parent | 7b19e13d324ba932f3e887c1100d18e4e9b353dc (diff) | |
| download | rust-9f44caa8579d69e829d89ffaae0260c85141fdfc.tar.gz rust-9f44caa8579d69e829d89ffaae0260c85141fdfc.zip | |
Do not treat vtable supertraits as distinct when bound with different bound vars
| -rw-r--r-- | src/constant.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/constant.rs b/src/constant.rs index 3e7b81a96b6..05ba53430a8 100644 --- a/src/constant.rs +++ b/src/constant.rs @@ -245,7 +245,10 @@ pub(crate) fn data_id_for_vtable<'tcx>( ty: Ty<'tcx>, trait_ref: Option<Binder<'tcx, ExistentialTraitRef<'tcx>>>, ) -> DataId { - let alloc_id = tcx.vtable_allocation((ty, trait_ref)); + let alloc_id = tcx.vtable_allocation(( + ty, + trait_ref.map(|principal| tcx.instantiate_bound_regions_with_erased(principal)), + )); data_id_for_alloc_id(cx, module, alloc_id, Mutability::Not) } |
