We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 31bc7e2 commit d6c1bb5Copy full SHA for d6c1bb5
compiler/rustc_const_eval/src/const_eval/eval_queries.rs
@@ -132,8 +132,8 @@ pub(super) fn op_to_const<'tcx>(
132
// functionality.)
133
_ => false,
134
};
135
- let immediate = if force_as_immediate {
136
- Right(ecx.read_immediate(op).expect("normalization works on validated constants"))
+ let immediate = if force_as_immediate && let Ok(imm) = ecx.read_immediate(op) {
+ Right(imm)
137
} else {
138
op.as_mplace_or_imm()
139
0 commit comments