We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 459c83f commit ef34e06Copy full SHA for ef34e06
compiler/rustc_mir/src/interpret/intrinsics.rs
@@ -83,7 +83,26 @@ crate fn eval_nullary_intrinsic<'tcx>(
83
| ty::Bound(_, _)
84
| ty::Placeholder(_)
85
| ty::Infer(_) => throw_inval!(TooGeneric),
86
- _ => ConstValue::from_machine_usize(0u64, &tcx),
+ 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),
106
},
107
other => bug!("`{}` is not a zero arg intrinsic", other),
108
})
0 commit comments