opaque types may also be sized
This commit is contained in:
parent
ef0ba1d2ce
commit
1d834cb657
3 changed files with 37 additions and 13 deletions
|
@ -2282,19 +2282,18 @@ impl<'tcx> Ty<'tcx> {
|
|||
ty::Str | ty::Slice(_) => (tcx.types.usize, false),
|
||||
ty::Dynamic(..) => {
|
||||
let dyn_metadata = tcx.lang_items().dyn_metadata().unwrap();
|
||||
(tcx.type_of(dyn_metadata).subst(tcx, &[self.into()]), false)
|
||||
(tcx.type_of(dyn_metadata).subst(tcx, &[tail.into()]), false)
|
||||
},
|
||||
|
||||
// type parameters only have unit metadata if they're sized, so return true
|
||||
// to make sure we double check this during confirmation
|
||||
ty::Param(_) | ty::Projection(_) => (tcx.types.unit, true),
|
||||
ty::Param(_) | ty::Projection(_) | ty::Opaque(..) => (tcx.types.unit, true),
|
||||
|
||||
ty::Opaque(..)
|
||||
| ty::Infer(ty::TyVar(_))
|
||||
ty::Infer(ty::TyVar(_))
|
||||
| ty::Bound(..)
|
||||
| ty::Placeholder(..)
|
||||
| ty::Infer(ty::FreshTy(_) | ty::FreshIntTy(_) | ty::FreshFloatTy(_)) => {
|
||||
bug!("`ptr_metadata_ty` applied to unexpected type: {:?}", self)
|
||||
bug!("`ptr_metadata_ty` applied to unexpected type: {:?} (tail = {:?})", self, tail)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue