fix ptr_metadata_ty for DynStar type
This commit is contained in:
parent
a38a3bfc6d
commit
4999000da1
@ -2735,6 +2735,8 @@ impl<'tcx> Ty<'tcx> {
|
|||||||
| ty::Error(_)
|
| ty::Error(_)
|
||||||
// Extern types have metadata = ().
|
// Extern types have metadata = ().
|
||||||
| ty::Foreign(..)
|
| ty::Foreign(..)
|
||||||
|
// `dyn*` has no metadata
|
||||||
|
| ty::Dynamic(_, _, DynKind::DynStar)
|
||||||
// If returned by `struct_tail_without_normalization` this is a unit struct
|
// If returned by `struct_tail_without_normalization` this is a unit struct
|
||||||
// without any fields, or not a struct, and therefore is Sized.
|
// without any fields, or not a struct, and therefore is Sized.
|
||||||
| ty::Adt(..)
|
| ty::Adt(..)
|
||||||
@ -2743,7 +2745,7 @@ impl<'tcx> Ty<'tcx> {
|
|||||||
| ty::Tuple(..) => (tcx.types.unit, false),
|
| ty::Tuple(..) => (tcx.types.unit, false),
|
||||||
|
|
||||||
ty::Str | ty::Slice(_) => (tcx.types.usize, false),
|
ty::Str | ty::Slice(_) => (tcx.types.usize, false),
|
||||||
ty::Dynamic(..) => {
|
ty::Dynamic(_, _, DynKind::Dyn) => {
|
||||||
let dyn_metadata = tcx.require_lang_item(LangItem::DynMetadata, None);
|
let dyn_metadata = tcx.require_lang_item(LangItem::DynMetadata, None);
|
||||||
(tcx.type_of(dyn_metadata).instantiate(tcx, &[tail.into()]), false)
|
(tcx.type_of(dyn_metadata).instantiate(tcx, &[tail.into()]), false)
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user