about summary refs log tree commit diff
diff options
context:
space:
mode:
authorlcnr <rust@lcnr.de>2023-02-13 10:45:43 +0100
committerlcnr <rust@lcnr.de>2023-02-13 10:47:12 +0100
commit9e84b00d447b5cb878a6b4e4001a94d4ea3531ca (patch)
tree9fca327ee7bff7029960f408f58e958200d58bb8
parent96834f0231277e8feb8dcf185b2af082ad2e39f6 (diff)
downloadrust-9e84b00d447b5cb878a6b4e4001a94d4ea3531ca.tar.gz
rust-9e84b00d447b5cb878a6b4e4001a94d4ea3531ca.zip
layout: deal with placeholders, ICE on bound types
a placeholder type is the same as a param as they
represent "this could be any type". A bound type
represents a type inside of a `for<T>` or `exists<T>`.
When entering a forall or exists `T` should be
instantiated as a existential (inference var) or universal
(placeholder). You should never observe a bound variable
without its binder.
-rw-r--r--compiler/rustc_ty_utils/src/layout.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/compiler/rustc_ty_utils/src/layout.rs b/compiler/rustc_ty_utils/src/layout.rs
index 2aeb255c164..13728919878 100644
--- a/compiler/rustc_ty_utils/src/layout.rs
+++ b/compiler/rustc_ty_utils/src/layout.rs
@@ -470,14 +470,11 @@ fn layout_of_uncached<'tcx>(
             return Err(LayoutError::Unknown(ty));
         }
 
-        ty::Placeholder(..)
-        | ty::GeneratorWitness(..)
-        | ty::GeneratorWitnessMIR(..)
-        | ty::Infer(_) => {
+        ty::Bound(..) | ty::GeneratorWitness(..) | ty::GeneratorWitnessMIR(..) | ty::Infer(_) => {
             bug!("Layout::compute: unexpected type `{}`", ty)
         }
 
-        ty::Bound(..) | ty::Param(_) | ty::Error(_) => {
+        ty::Placeholder(..) | ty::Param(_) | ty::Error(_) => {
             return Err(LayoutError::Unknown(ty));
         }
     })