Skip to content

Commit 7efe24c

Browse files
authored
Rollup merge of rust-lang#100181 - RalfJung:alloc-ref-mutability, r=jackh726
add method to get the mutability of an AllocId Miri needs this for rust-lang/miri#2463.
2 parents e41be25 + 54b122e commit 7efe24c

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

compiler/rustc_const_eval/src/interpret/memory.rs

+7
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
520520

521521
/// Gives raw access to the `Allocation`, without bounds or alignment checks.
522522
/// The caller is responsible for calling the access hooks!
523+
///
524+
/// You almost certainly want to use `get_ptr_alloc`/`get_ptr_alloc_mut` instead.
523525
fn get_alloc_raw(
524526
&self,
525527
id: AllocId,
@@ -589,6 +591,11 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
589591
Ok(&self.get_alloc_raw(id)?.extra)
590592
}
591593

594+
/// Return the `mutability` field of the given allocation.
595+
pub fn get_alloc_mutability<'a>(&'a self, id: AllocId) -> InterpResult<'tcx, Mutability> {
596+
Ok(self.get_alloc_raw(id)?.mutability)
597+
}
598+
592599
/// Gives raw mutable access to the `Allocation`, without bounds or alignment checks.
593600
/// The caller is responsible for calling the access hooks!
594601
///

src/bootstrap/test.rs

+4
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,10 @@ impl Step for Miri {
628628
cargo.env("MIRI_HOST_SYSROOT", sysroot);
629629
cargo.env("RUSTC_LIB_PATH", builder.rustc_libdir(compiler));
630630
cargo.env("MIRI", miri);
631+
// propagate --bless
632+
if builder.config.cmd.bless() {
633+
cargo.env("MIRI_BLESS", "Gesundheit");
634+
}
631635

632636
cargo.arg("--").args(builder.config.cmd.test_args());
633637

0 commit comments

Comments
 (0)