1
Fork 0

Use Mutability::{is_mut, is_not}

This commit is contained in:
Maybe Waffle 2023-01-30 12:00:11 +00:00
parent fd649a3cc5
commit 4d75f61832
11 changed files with 13 additions and 21 deletions

View file

@ -5,7 +5,6 @@ use std::cell::Cell;
use either::Right;
use rustc_ast::Mutability;
use rustc_const_eval::const_eval::CheckAlignment;
use rustc_data_structures::fx::FxHashSet;
use rustc_hir::def::DefKind;
@ -289,7 +288,7 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for ConstPropMachine<'mir, 'tcx>
}
// If the static allocation is mutable, then we can't const prop it as its content
// might be different at runtime.
if alloc.inner().mutability == Mutability::Mut {
if alloc.inner().mutability.is_mut() {
throw_machine_stop_str!("can't access mutable globals in ConstProp");
}