Skip to content

Commit ef34e06

Browse files
author
Ngo Iok Ui
committed
List all variants of TyKind
1 parent 459c83f commit ef34e06

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

compiler/rustc_mir/src/interpret/intrinsics.rs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,26 @@ crate fn eval_nullary_intrinsic<'tcx>(
8383
| ty::Bound(_, _)
8484
| ty::Placeholder(_)
8585
| ty::Infer(_) => throw_inval!(TooGeneric),
86-
_ => ConstValue::from_machine_usize(0u64, &tcx),
86+
ty::Bool
87+
| ty::Char
88+
| ty::Int(_)
89+
| ty::Uint(_)
90+
| ty::Float(_)
91+
| ty::Foreign(_)
92+
| ty::Str
93+
| ty::Array(_, _)
94+
| ty::Slice(_)
95+
| ty::RawPtr(_)
96+
| ty::Ref(_, _, _)
97+
| ty::FnDef(_, _)
98+
| ty::FnPtr(_)
99+
| ty::Dynamic(_, _)
100+
| ty::Closure(_, _)
101+
| ty::Generator(_, _, _)
102+
| ty::GeneratorWitness(_)
103+
| ty::Never
104+
| ty::Tuple(_)
105+
| ty::Error(_) => ConstValue::from_machine_usize(0u64, &tcx),
87106
},
88107
other => bug!("`{}` is not a zero arg intrinsic", other),
89108
})

0 commit comments

Comments
 (0)