Rollup merge of #111490 - compiler-errors:layout-placeholder, r=aliemjay
Don't ICE in layout computation for placeholder types We use `layout_of` for the built-in `PointerLike` trait to check if a type can be coerced to a `dyn*`. Since the new solver canonicalizes parameter types to placeholders, that code needs to be able to treat placeholders like params, and for the most part it does, **except** for a call to `is_trivially_sized`. This PR fixes that.
This commit is contained in:
commit
4c12f5d252
4 changed files with 21 additions and 5 deletions
|
|
@ -2366,13 +2366,11 @@ impl<'tcx> Ty<'tcx> {
|
|||
|
||||
ty::Adt(def, _substs) => def.sized_constraint(tcx).0.is_empty(),
|
||||
|
||||
ty::Alias(..) | ty::Param(_) => false,
|
||||
ty::Alias(..) | ty::Param(_) | ty::Placeholder(..) => false,
|
||||
|
||||
ty::Infer(ty::TyVar(_)) => false,
|
||||
|
||||
ty::Bound(..)
|
||||
| ty::Placeholder(..)
|
||||
| ty::Infer(ty::FreshTy(_) | ty::FreshIntTy(_) | ty::FreshFloatTy(_)) => {
|
||||
ty::Bound(..) | ty::Infer(ty::FreshTy(_) | ty::FreshIntTy(_) | ty::FreshFloatTy(_)) => {
|
||||
bug!("`is_trivially_sized` applied to unexpected type: {:?}", self)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue