We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5808d42 commit a8e9b46Copy full SHA for a8e9b46
compiler/rustc_mir_transform/src/promote_consts.rs
@@ -325,7 +325,7 @@ impl<'tcx> Validator<'_, 'tcx> {
325
if let TempState::Defined { location: loc, .. } = self.temps[local]
326
&& let Left(statement) = self.body.stmt_at(loc)
327
&& let Some((_, Rvalue::Use(Operand::Constant(c)))) = statement.kind.as_assign()
328
- && let Some(idx) = c.const_.try_eval_target_usize(self.tcx, self.typing_env)
+ && let Some(idx) = c.const_.try_eval_target_usize(self.tcx, self.typing_env)
329
// Determine the type of the thing we are indexing.
330
&& let ty::Array(_, len) = place_base.ty(self.body, self.tcx).ty.kind()
331
// It's an array; determine its length.
0 commit comments