1
Fork 0

Auto merge of #107772 - compiler-errors:dyn-star-backend-is-ptr, r=eholk

Make `dyn*`'s value backend type a pointer

One tweak on top of Ralf's commit should fix using `usize` as a `dyn*`-coercible type, and should fix when we're using various other pointer types when LLVM opaque pointers is disabled.

r? `@eholk` but feel free to reassign
cc https://github.com/rust-lang/rust/pull/107728#issuecomment-1421231823 `@RalfJung`
This commit is contained in:
bors 2023-02-19 05:35:03 +00:00
commit 73f40197ec
8 changed files with 129 additions and 95 deletions

View file

@ -770,7 +770,7 @@ where
ty::Dynamic(_, _, ty::DynStar) => {
if i == 0 {
TyMaybeWithLayout::Ty(tcx.types.usize)
TyMaybeWithLayout::Ty(tcx.mk_mut_ptr(tcx.types.unit))
} else if i == 1 {
// FIXME(dyn-star) same FIXME as above applies here too
TyMaybeWithLayout::Ty(