about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNgo Iok Ui <wusyong9104@gmail.com>2020-11-21 13:45:59 +0800
committerNgo Iok Ui <wusyong9104@gmail.com>2020-11-21 13:45:59 +0800
commitef34e067817448d8ffbb9ac70e97699bf8b7566e (patch)
treefccf3ff58c0d19460399571ac9838021fdfede57
parent459c83f98026551bb0d3d86ede21e6d7424d375e (diff)
downloadrust-ef34e067817448d8ffbb9ac70e97699bf8b7566e.tar.gz
rust-ef34e067817448d8ffbb9ac70e97699bf8b7566e.zip
List all variants of TyKind
-rw-r--r--compiler/rustc_mir/src/interpret/intrinsics.rs21
1 files changed, 20 insertions, 1 deletions
diff --git a/compiler/rustc_mir/src/interpret/intrinsics.rs b/compiler/rustc_mir/src/interpret/intrinsics.rs
index d4857e00d3a..f666a89ca56 100644
--- a/compiler/rustc_mir/src/interpret/intrinsics.rs
+++ b/compiler/rustc_mir/src/interpret/intrinsics.rs
@@ -83,7 +83,26 @@ crate fn eval_nullary_intrinsic<'tcx>(
             | ty::Bound(_, _)
             | ty::Placeholder(_)
             | ty::Infer(_) => throw_inval!(TooGeneric),
-            _ => ConstValue::from_machine_usize(0u64, &tcx),
+            ty::Bool
+            | ty::Char
+            | ty::Int(_)
+            | ty::Uint(_)
+            | ty::Float(_)
+            | ty::Foreign(_)
+            | ty::Str
+            | ty::Array(_, _)
+            | ty::Slice(_)
+            | ty::RawPtr(_)
+            | ty::Ref(_, _, _)
+            | ty::FnDef(_, _)
+            | ty::FnPtr(_)
+            | ty::Dynamic(_, _)
+            | ty::Closure(_, _)
+            | ty::Generator(_, _, _)
+            | ty::GeneratorWitness(_)
+            | ty::Never
+            | ty::Tuple(_)
+            | ty::Error(_) => ConstValue::from_machine_usize(0u64, &tcx),
         },
         other => bug!("`{}` is not a zero arg intrinsic", other),
     })