Skip to content

Commit 21527d2

Browse files
committed
Tree Borrows: print where the forbidden access happens; make tag tracking less verbose
1 parent be5da3a commit 21527d2

File tree

51 files changed

+125
-104
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+125
-104
lines changed

src/tools/miri/src/borrow_tracker/mod.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,12 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
377377
if matches!(kind, AllocKind::LiveData) {
378378
let alloc_extra = this.get_alloc_extra(*alloc_id)?; // can still fail for `extern static`
379379
let alloc_borrow_tracker = &alloc_extra.borrow_tracker.as_ref().unwrap();
380-
alloc_borrow_tracker.release_protector(&this.machine, borrow_tracker, *tag)?;
380+
alloc_borrow_tracker.release_protector(
381+
&this.machine,
382+
borrow_tracker,
383+
*tag,
384+
*alloc_id,
385+
)?;
381386
}
382387
}
383388
borrow_tracker.borrow_mut().end_call(&frame.extra);
@@ -491,10 +496,12 @@ impl AllocState {
491496
machine: &MiriMachine<'_, 'tcx>,
492497
global: &GlobalState,
493498
tag: BorTag,
499+
alloc_id: AllocId, // diagnostics
494500
) -> InterpResult<'tcx> {
495501
match self {
496502
AllocState::StackedBorrows(_sb) => Ok(()),
497-
AllocState::TreeBorrows(tb) => tb.borrow_mut().release_protector(machine, global, tag),
503+
AllocState::TreeBorrows(tb) =>
504+
tb.borrow_mut().release_protector(machine, global, tag, alloc_id),
498505
}
499506
}
500507
}

src/tools/miri/src/borrow_tracker/tree_borrows/diagnostics.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,8 @@ impl History {
278278
pub(super) struct TbError<'node> {
279279
/// What failure occurred.
280280
pub error_kind: TransitionError,
281+
/// The allocation in which the error is happening.
282+
pub alloc_id: AllocId,
281283
/// The offset (into the allocation) at which the conflict occurred.
282284
pub error_offset: u64,
283285
/// The tag on which the error was triggered.
@@ -300,7 +302,11 @@ impl TbError<'_> {
300302
let accessed = self.accessed_info;
301303
let conflicting = self.conflicting_info;
302304
let accessed_is_conflicting = accessed.tag == conflicting.tag;
303-
let title = format!("{cause} through {accessed} is forbidden");
305+
let title = format!(
306+
"{cause} through {accessed} at {alloc_id:?}[{offset:#x}] is forbidden",
307+
alloc_id = self.alloc_id,
308+
offset = self.error_offset
309+
);
304310
let (title, details, conflicting_tag_name) = match self.error_kind {
305311
ChildAccessForbidden(perm) => {
306312
let conflicting_tag_name =

src/tools/miri/src/borrow_tracker/tree_borrows/mod.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
use rustc_target::abi::{Abi, Size};
2-
3-
use crate::borrow_tracker::{GlobalState, GlobalStateInner, ProtectorKind};
41
use rustc_middle::{
52
mir::{Mutability, RetagKind},
63
ty::{
@@ -10,7 +7,9 @@ use rustc_middle::{
107
},
118
};
129
use rustc_span::def_id::DefId;
10+
use rustc_target::abi::{Abi, Size};
1311

12+
use crate::borrow_tracker::{GlobalState, GlobalStateInner, ProtectorKind};
1413
use crate::*;
1514

1615
pub mod diagnostics;
@@ -70,6 +69,7 @@ impl<'tcx> Tree {
7069
tag,
7170
Some(range),
7271
global,
72+
alloc_id,
7373
span,
7474
diagnostics::AccessCause::Explicit(access_kind),
7575
)
@@ -78,7 +78,7 @@ impl<'tcx> Tree {
7878
/// Check that this pointer has permission to deallocate this range.
7979
pub fn before_memory_deallocation(
8080
&mut self,
81-
_alloc_id: AllocId,
81+
alloc_id: AllocId,
8282
prov: ProvenanceExtra,
8383
range: AllocRange,
8484
machine: &MiriMachine<'_, 'tcx>,
@@ -91,7 +91,7 @@ impl<'tcx> Tree {
9191
};
9292
let global = machine.borrow_tracker.as_ref().unwrap();
9393
let span = machine.current_span();
94-
self.dealloc(tag, range, global, span)
94+
self.dealloc(tag, range, global, alloc_id, span)
9595
}
9696

9797
pub fn expose_tag(&mut self, _tag: BorTag) {
@@ -109,13 +109,15 @@ impl<'tcx> Tree {
109109
machine: &MiriMachine<'_, 'tcx>,
110110
global: &GlobalState,
111111
tag: BorTag,
112+
alloc_id: AllocId, // diagnostics
112113
) -> InterpResult<'tcx> {
113114
let span = machine.current_span();
114115
self.perform_access(
115116
AccessKind::Read,
116117
tag,
117118
None, // no specified range because it occurs on the entire allocation
118119
global,
120+
alloc_id,
119121
span,
120122
diagnostics::AccessCause::FnExit,
121123
)
@@ -211,7 +213,7 @@ trait EvalContextPrivExt<'mir: 'ecx, 'tcx: 'mir, 'ecx>: crate::MiriInterpCxExt<'
211213
let global = this.machine.borrow_tracker.as_ref().unwrap().borrow();
212214
let ty = place.layout.ty;
213215
if global.tracked_pointer_tags.contains(&new_tag) {
214-
let kind_str = format!("{new_perm:?} (pointee type {ty})");
216+
let kind_str = format!("initial state {} (pointee type {ty})", new_perm.initial_state);
215217
this.emit_diagnostic(NonHaltingDiagnostic::CreatedPointerTag(
216218
new_tag.inner(),
217219
Some(kind_str),
@@ -299,6 +301,7 @@ trait EvalContextPrivExt<'mir: 'ecx, 'tcx: 'mir, 'ecx>: crate::MiriInterpCxExt<'
299301
orig_tag,
300302
Some(range),
301303
this.machine.borrow_tracker.as_ref().unwrap(),
304+
alloc_id,
302305
this.machine.current_span(),
303306
diagnostics::AccessCause::Reborrow,
304307
)?;

src/tools/miri/src/borrow_tracker/tree_borrows/tree.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,13 +516,15 @@ impl<'tcx> Tree {
516516
tag: BorTag,
517517
access_range: AllocRange,
518518
global: &GlobalState,
519-
span: Span, // diagnostics
519+
alloc_id: AllocId, // diagnostics
520+
span: Span, // diagnostics
520521
) -> InterpResult<'tcx> {
521522
self.perform_access(
522523
AccessKind::Write,
523524
tag,
524525
Some(access_range),
525526
global,
527+
alloc_id,
526528
span,
527529
diagnostics::AccessCause::Dealloc,
528530
)?;
@@ -545,6 +547,7 @@ impl<'tcx> Tree {
545547
TbError {
546548
conflicting_info,
547549
access_cause: diagnostics::AccessCause::Dealloc,
550+
alloc_id,
548551
error_offset: perms_range.start,
549552
error_kind,
550553
accessed_info,
@@ -576,6 +579,7 @@ impl<'tcx> Tree {
576579
tag: BorTag,
577580
access_range: Option<AllocRange>,
578581
global: &GlobalState,
582+
alloc_id: AllocId, // diagnostics
579583
span: Span, // diagnostics
580584
access_cause: diagnostics::AccessCause, // diagnostics
581585
) -> InterpResult<'tcx> {
@@ -628,6 +632,7 @@ impl<'tcx> Tree {
628632
TbError {
629633
conflicting_info,
630634
access_cause,
635+
alloc_id,
631636
error_offset: perms_range.start,
632637
error_kind,
633638
accessed_info,

src/tools/miri/tests/fail/both_borrows/alias_through_mutation.tree.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error: Undefined Behavior: read access through <TAG> is forbidden
1+
error: Undefined Behavior: read access through <TAG> at ALLOC[0x0] is forbidden
22
--> $DIR/alias_through_mutation.rs:LL:CC
33
|
44
LL | let _val = *target_alias;
5-
| ^^^^^^^^^^^^^ read access through <TAG> is forbidden
5+
| ^^^^^^^^^^^^^ read access through <TAG> at ALLOC[0x0] is forbidden
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
88
= help: the accessed tag <TAG> is a child of the conflicting tag <TAG>

src/tools/miri/tests/fail/both_borrows/aliasing_mut1.tree.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error: Undefined Behavior: write access through <TAG> is forbidden
1+
error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
22
--> $DIR/aliasing_mut1.rs:LL:CC
33
|
44
LL | *x = 1;
5-
| ^^^^^^ write access through <TAG> is forbidden
5+
| ^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
88
= help: the accessed tag <TAG> has state Reserved (conflicted) which forbids this child write access

src/tools/miri/tests/fail/both_borrows/aliasing_mut2.tree.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error: Undefined Behavior: write access through <TAG> is forbidden
1+
error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
22
--> $DIR/aliasing_mut2.rs:LL:CC
33
|
44
LL | *y = 2;
5-
| ^^^^^^ write access through <TAG> is forbidden
5+
| ^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
88
= help: the accessed tag <TAG> has state Reserved (conflicted) which forbids this child write access

src/tools/miri/tests/fail/both_borrows/aliasing_mut3.tree.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error: Undefined Behavior: write access through <TAG> is forbidden
1+
error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
22
--> $DIR/aliasing_mut3.rs:LL:CC
33
|
44
LL | *x = 1;
5-
| ^^^^^^ write access through <TAG> is forbidden
5+
| ^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
88
= help: the accessed tag <TAG> has state Reserved (conflicted) which forbids this child write access

src/tools/miri/tests/fail/both_borrows/aliasing_mut4.tree.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error: Undefined Behavior: write access through <TAG> is forbidden
1+
error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
22
--> RUSTLIB/core/src/mem/mod.rs:LL:CC
33
|
44
LL | ptr::write(dest, src);
5-
| ^^^^^^^^^^^^^^^^^^^^^ write access through <TAG> is forbidden
5+
| ^^^^^^^^^^^^^^^^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
88
= help: the accessed tag <TAG> is foreign to the protected tag <TAG> (i.e., it is not a child)

src/tools/miri/tests/fail/both_borrows/box_exclusive_violation1.tree.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error: Undefined Behavior: write access through <TAG> is forbidden
1+
error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
22
--> $DIR/box_exclusive_violation1.rs:LL:CC
33
|
44
LL | *LEAK = 7;
5-
| ^^^^^^^^^ write access through <TAG> is forbidden
5+
| ^^^^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
88
= help: the accessed tag <TAG> is a child of the conflicting tag <TAG>

src/tools/miri/tests/fail/both_borrows/box_noalias_violation.tree.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error: Undefined Behavior: read access through <TAG> is forbidden
1+
error: Undefined Behavior: read access through <TAG> at ALLOC[0x0] is forbidden
22
--> $DIR/box_noalias_violation.rs:LL:CC
33
|
44
LL | *y
5-
| ^^ read access through <TAG> is forbidden
5+
| ^^ read access through <TAG> at ALLOC[0x0] is forbidden
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
88
= help: the accessed tag <TAG> is foreign to the protected tag <TAG> (i.e., it is not a child)

src/tools/miri/tests/fail/both_borrows/buggy_as_mut_slice.tree.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error: Undefined Behavior: write access through <TAG> is forbidden
1+
error: Undefined Behavior: write access through <TAG> at ALLOC[0x4] is forbidden
22
--> $DIR/buggy_as_mut_slice.rs:LL:CC
33
|
44
LL | v2[1] = 7;
5-
| ^^^^^^^^^ write access through <TAG> is forbidden
5+
| ^^^^^^^^^ write access through <TAG> at ALLOC[0x4] is forbidden
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
88
= help: the accessed tag <TAG> is a child of the conflicting tag <TAG>

src/tools/miri/tests/fail/both_borrows/buggy_split_at_mut.tree.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error: Undefined Behavior: write access through <TAG> is forbidden
1+
error: Undefined Behavior: write access through <TAG> at ALLOC[0x4] is forbidden
22
--> $DIR/buggy_split_at_mut.rs:LL:CC
33
|
44
LL | b[1] = 6;
5-
| ^^^^^^^^ write access through <TAG> is forbidden
5+
| ^^^^^^^^ write access through <TAG> at ALLOC[0x4] is forbidden
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
88
= help: the accessed tag <TAG> is a child of the conflicting tag <TAG>

src/tools/miri/tests/fail/both_borrows/illegal_write1.tree.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error: Undefined Behavior: write access through <TAG> is forbidden
1+
error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
22
--> $DIR/illegal_write1.rs:LL:CC
33
|
44
LL | unsafe { *x = 42 };
5-
| ^^^^^^^ write access through <TAG> is forbidden
5+
| ^^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
88
= help: the accessed tag <TAG> has state Frozen which forbids this child write access

src/tools/miri/tests/fail/both_borrows/illegal_write5.tree.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error: Undefined Behavior: read access through <TAG> is forbidden
1+
error: Undefined Behavior: read access through <TAG> at ALLOC[0x0] is forbidden
22
--> $DIR/illegal_write5.rs:LL:CC
33
|
44
LL | let _val = *xref;
5-
| ^^^^^ read access through <TAG> is forbidden
5+
| ^^^^^ read access through <TAG> at ALLOC[0x0] is forbidden
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
88
= help: the accessed tag <TAG> is a child of the conflicting tag <TAG>

src/tools/miri/tests/fail/both_borrows/illegal_write6.tree.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error: Undefined Behavior: write access through <TAG> is forbidden
1+
error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
22
--> $DIR/illegal_write6.rs:LL:CC
33
|
44
LL | unsafe { *y = 2 };
5-
| ^^^^^^ write access through <TAG> is forbidden
5+
| ^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
88
= help: the accessed tag <TAG> is foreign to the protected tag <TAG> (i.e., it is not a child)

src/tools/miri/tests/fail/both_borrows/invalidate_against_protector2.tree.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error: Undefined Behavior: write access through <TAG> is forbidden
1+
error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
22
--> $DIR/invalidate_against_protector2.rs:LL:CC
33
|
44
LL | unsafe { *x = 0 };
5-
| ^^^^^^ write access through <TAG> is forbidden
5+
| ^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
88
= help: the accessed tag <TAG> is foreign to the protected tag <TAG> (i.e., it is not a child)

src/tools/miri/tests/fail/both_borrows/invalidate_against_protector3.tree.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error: Undefined Behavior: write access through <TAG> (root of the allocation) is forbidden
1+
error: Undefined Behavior: write access through <TAG> (root of the allocation) at ALLOC[0x0] is forbidden
22
--> $DIR/invalidate_against_protector3.rs:LL:CC
33
|
44
LL | unsafe { *x = 0 };
5-
| ^^^^^^ write access through <TAG> (root of the allocation) is forbidden
5+
| ^^^^^^ write access through <TAG> (root of the allocation) at ALLOC[0x0] is forbidden
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
88
= help: the accessed tag <TAG> (root of the allocation) is foreign to the protected tag <TAG> (i.e., it is not a child)

src/tools/miri/tests/fail/both_borrows/load_invalid_shr.tree.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error: Undefined Behavior: reborrow through <TAG> is forbidden
1+
error: Undefined Behavior: reborrow through <TAG> at ALLOC[0x0] is forbidden
22
--> $DIR/load_invalid_shr.rs:LL:CC
33
|
44
LL | let _val = *xref_in_mem;
5-
| ^^^^^^^^^^^^ reborrow through <TAG> is forbidden
5+
| ^^^^^^^^^^^^ reborrow through <TAG> at ALLOC[0x0] is forbidden
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
88
= help: the accessed tag <TAG> is a child of the conflicting tag <TAG>

src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation1.tree.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error: Undefined Behavior: write access through <TAG> is forbidden
1+
error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
22
--> $DIR/mut_exclusive_violation1.rs:LL:CC
33
|
44
LL | *LEAK = 7;
5-
| ^^^^^^^^^ write access through <TAG> is forbidden
5+
| ^^^^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
88
= help: the accessed tag <TAG> is a child of the conflicting tag <TAG>

src/tools/miri/tests/fail/both_borrows/mut_exclusive_violation2.tree.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error: Undefined Behavior: write access through <TAG> is forbidden
1+
error: Undefined Behavior: write access through <TAG> at ALLOC[0x0] is forbidden
22
--> $DIR/mut_exclusive_violation2.rs:LL:CC
33
|
44
LL | *raw1 = 3;
5-
| ^^^^^^^^^ write access through <TAG> is forbidden
5+
| ^^^^^^^^^ write access through <TAG> at ALLOC[0x0] is forbidden
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
88
= help: the accessed tag <TAG> is a child of the conflicting tag <TAG>

src/tools/miri/tests/fail/both_borrows/newtype_pair_retagging.tree.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error: Undefined Behavior: deallocation through <TAG> is forbidden
1+
error: Undefined Behavior: deallocation through <TAG> at ALLOC[0x0] is forbidden
22
--> RUSTLIB/alloc/src/alloc.rs:LL:CC
33
|
44
LL | unsafe { __rust_dealloc(ptr, layout.size(), layout.align()) }
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ deallocation through <TAG> is forbidden
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ deallocation through <TAG> at ALLOC[0x0] is forbidden
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
88
= help: the accessed tag <TAG> is foreign to the protected tag <TAG> (i.e., it is not a child)

src/tools/miri/tests/fail/both_borrows/newtype_retagging.tree.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error: Undefined Behavior: deallocation through <TAG> is forbidden
1+
error: Undefined Behavior: deallocation through <TAG> at ALLOC[0x0] is forbidden
22
--> RUSTLIB/alloc/src/alloc.rs:LL:CC
33
|
44
LL | unsafe { __rust_dealloc(ptr, layout.size(), layout.align()) }
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ deallocation through <TAG> is forbidden
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ deallocation through <TAG> at ALLOC[0x0] is forbidden
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
88
= help: the accessed tag <TAG> is foreign to the protected tag <TAG> (i.e., it is not a child)

src/tools/miri/tests/fail/both_borrows/outdated_local.tree.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error: Undefined Behavior: read access through <TAG> is forbidden
1+
error: Undefined Behavior: read access through <TAG> at ALLOC[0x0] is forbidden
22
--> $DIR/outdated_local.rs:LL:CC
33
|
44
LL | assert_eq!(unsafe { *y }, 1);
5-
| ^^ read access through <TAG> is forbidden
5+
| ^^ read access through <TAG> at ALLOC[0x0] is forbidden
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
88
= help: the accessed tag <TAG> has state Disabled which forbids this child read access

src/tools/miri/tests/fail/both_borrows/pass_invalid_shr.tree.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error: Undefined Behavior: reborrow through <TAG> is forbidden
1+
error: Undefined Behavior: reborrow through <TAG> at ALLOC[0x0] is forbidden
22
--> $DIR/pass_invalid_shr.rs:LL:CC
33
|
44
LL | foo(xref);
5-
| ^^^^ reborrow through <TAG> is forbidden
5+
| ^^^^ reborrow through <TAG> at ALLOC[0x0] is forbidden
66
|
77
= help: this indicates a potential bug in the program: it performed an invalid operation, but the Tree Borrows rules it violated are still experimental
88
= help: the accessed tag <TAG> has state Disabled which forbids this reborrow (acting as a child read access)

0 commit comments

Comments
 (0)