Skip to content

Commit efec694

Browse files
committed
Auto merge of #143254 - matthiaskrgr:rollup-7x8bxek, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - rust-lang/rust#143019 (Ensure -V --verbose processes both codegen_backend and codegen-backend) - rust-lang/rust#143140 (give Pointer::into_parts a more scary name and offer a safer alternative) - rust-lang/rust#143175 (Make combining LLD with external LLVM config a hard error) - rust-lang/rust#143180 (Use `tracing-forest` instead of `tracing-tree` for bootstrap tracing) - rust-lang/rust#143223 (Improve macro stats printing) - rust-lang/rust#143228 (Handle build scripts better in `-Zmacro-stats` output.) - rust-lang/rust#143229 ([COMPILETEST-UNTANGLE 1/N] Move some some early config checks to the lib and move the compiletest binary) - rust-lang/rust#143246 (Subtree update of `rust-analyzer`) - rust-lang/rust#143248 (Update books) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 6b0e60f + d022fc2 commit efec694

File tree

5 files changed

+7
-9
lines changed

5 files changed

+7
-9
lines changed

src/alloc_addresses/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
390390
) -> InterpResult<'tcx, interpret::Pointer<Provenance>> {
391391
let this = self.eval_context_ref();
392392

393-
let (prov, offset) = ptr.into_parts(); // offset is relative (AllocId provenance)
393+
let (prov, offset) = ptr.prov_and_relative_offset();
394394
let alloc_id = prov.alloc_id();
395395

396396
// Get a pointer to the beginning of this allocation.
@@ -447,7 +447,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
447447
) -> Option<(AllocId, Size)> {
448448
let this = self.eval_context_ref();
449449

450-
let (tag, addr) = ptr.into_parts(); // addr is absolute (Tag provenance)
450+
let (tag, addr) = ptr.into_raw_parts(); // addr is absolute (Miri provenance)
451451

452452
let alloc_id = if let Provenance::Concrete { alloc_id, .. } = tag {
453453
alloc_id

src/machine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ impl interpret::Provenance for Provenance {
285285
}
286286

287287
fn fmt(ptr: &interpret::Pointer<Self>, f: &mut fmt::Formatter<'_>) -> fmt::Result {
288-
let (prov, addr) = ptr.into_parts(); // address is absolute
288+
let (prov, addr) = ptr.into_raw_parts(); // offset is absolute address
289289
write!(f, "{:#x}", addr.bytes())?;
290290
if f.alternate() {
291291
write!(f, "{prov:#?}")?;

src/provenance_gc.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,13 @@ impl VisitProvenance for Provenance {
6868

6969
impl VisitProvenance for StrictPointer {
7070
fn visit_provenance(&self, visit: &mut VisitWith<'_>) {
71-
let (prov, _offset) = self.into_parts();
72-
prov.visit_provenance(visit);
71+
self.provenance.visit_provenance(visit);
7372
}
7473
}
7574

7675
impl VisitProvenance for Pointer {
7776
fn visit_provenance(&self, visit: &mut VisitWith<'_>) {
78-
let (prov, _offset) = self.into_parts();
79-
prov.visit_provenance(visit);
77+
self.provenance.visit_provenance(visit);
8078
}
8179
}
8280

src/shims/foreign_items.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
411411
AlignFromBytesError::TooLarge(_) => Align::MAX,
412412
}
413413
});
414-
let (_, addr) = ptr.into_parts(); // we know the offset is absolute
414+
let addr = ptr.addr();
415415
// Cannot panic since `align` is a power of 2 and hence non-zero.
416416
if addr.bytes().strict_rem(align.bytes()) != 0 {
417417
throw_unsup_format!(

src/shims/unix/mem.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
4949
&& matches!(&*this.tcx.sess.target.os, "macos" | "solaris" | "illumos")
5050
&& (flags & map_fixed) != 0
5151
{
52-
return interp_ok(Scalar::from_maybe_pointer(Pointer::from_addr_invalid(addr), this));
52+
return interp_ok(Scalar::from_maybe_pointer(Pointer::without_provenance(addr), this));
5353
}
5454

5555
let prot_read = this.eval_libc_i32("PROT_READ");

0 commit comments

Comments
 (0)