Skip to content

Commit 7bd15aa

Browse files
committed
Auto merge of #2308 - RalfJung:ptr-tacking, r=RalfJung
pointer tag tracking: on creation, log the offsets it is created for Hopefully this makes things like Manishearth/triomphe#38 easier to diagnose.
2 parents 4282450 + 33e5e19 commit 7bd15aa

File tree

324 files changed

+353
-284
lines changed

Some content is hidden

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

324 files changed

+353
-284
lines changed

src/diagnostics.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl MachineStopType for TerminationInfo {}
6767

6868
/// Miri specific diagnostics
6969
pub enum NonHaltingDiagnostic {
70-
CreatedPointerTag(NonZeroU64),
70+
CreatedPointerTag(NonZeroU64, Option<(AllocId, AllocRange)>),
7171
/// This `Item` was popped from the borrow stack, either due to an access with the given tag or
7272
/// a deallocation when the second argument is `None`.
7373
PoppedPointerTag(Item, Option<(SbTagExtra, AccessKind)>),
@@ -318,7 +318,7 @@ fn report_msg<'mir, 'tcx>(
318318
diag_level: DiagLevel,
319319
title: &str,
320320
span_msg: Vec<String>,
321-
mut helps: Vec<(Option<SpanData>, String)>,
321+
helps: Vec<(Option<SpanData>, String)>,
322322
stacktrace: &[FrameInfo<'tcx>],
323323
) {
324324
let span = stacktrace.first().map_or(DUMMY_SP, |fi| fi.span);
@@ -344,15 +344,15 @@ fn report_msg<'mir, 'tcx>(
344344

345345
// Show help messages.
346346
if !helps.is_empty() {
347-
// Add visual separator before backtrace.
348-
helps.last_mut().unwrap().1.push('\n');
349347
for (span_data, help) in helps {
350348
if let Some(span_data) = span_data {
351349
err.span_help(span_data.span(), &help);
352350
} else {
353351
err.help(&help);
354352
}
355353
}
354+
// Add visual separator before backtrace.
355+
err.note("backtrace:");
356356
}
357357
// Add backtrace
358358
for (idx, frame_info) in stacktrace.iter().enumerate() {
@@ -448,7 +448,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
448448
for e in diagnostics.drain(..) {
449449
use NonHaltingDiagnostic::*;
450450
let msg = match e {
451-
CreatedPointerTag(tag) => format!("created tag {:?}", tag),
451+
CreatedPointerTag(tag, None) => format!("created tag {tag:?}"),
452+
CreatedPointerTag(tag, Some((alloc_id, range))) =>
453+
format!("created tag {tag:?} at {alloc_id}{}", HexRange(range)),
452454
PoppedPointerTag(item, tag) =>
453455
match tag {
454456
None =>

src/stacked_borrows.rs

+24-8
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,9 @@ impl GlobalStateInner {
222222
}
223223
}
224224

225+
/// Generates a new pointer tag. Remember to also check track_pointer_tags and log its creation!
225226
fn new_ptr(&mut self) -> SbTag {
226227
let id = self.next_ptr_tag;
227-
if self.tracked_pointer_tags.contains(&id) {
228-
register_diagnostic(NonHaltingDiagnostic::CreatedPointerTag(id.0));
229-
}
230228
self.next_ptr_tag = SbTag(NonZeroU64::new(id.0.get() + 1).unwrap());
231229
id
232230
}
@@ -253,6 +251,9 @@ impl GlobalStateInner {
253251
pub fn base_ptr_tag(&mut self, id: AllocId) -> SbTag {
254252
self.base_ptr_tags.get(&id).copied().unwrap_or_else(|| {
255253
let tag = self.new_ptr();
254+
if self.tracked_pointer_tags.contains(&tag) {
255+
register_diagnostic(NonHaltingDiagnostic::CreatedPointerTag(tag.0, None));
256+
}
256257
trace!("New allocation {:?} has base tag {:?}", id, tag);
257258
self.base_ptr_tags.try_insert(id, tag).unwrap();
258259
tag
@@ -802,16 +803,30 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
802803
let this = self.eval_context_mut();
803804
let current_span = &mut this.machine.current_span();
804805

806+
// It is crucial that this gets called on all code paths, to ensure we track tag creation.
805807
let log_creation = |this: &MiriEvalContext<'mir, 'tcx>,
806808
current_span: &mut CurrentSpan<'_, 'mir, 'tcx>,
807-
alloc_id,
808-
base_offset,
809-
orig_tag|
809+
loc: Option<(AllocId, Size, SbTagExtra)>| // alloc_id, base_offset, orig_tag
810810
-> InterpResult<'tcx> {
811+
let global = this.machine.stacked_borrows.as_ref().unwrap().borrow();
812+
if global.tracked_pointer_tags.contains(&new_tag) {
813+
register_diagnostic(NonHaltingDiagnostic::CreatedPointerTag(
814+
new_tag.0,
815+
loc.map(|(alloc_id, base_offset, _)| (alloc_id, alloc_range(base_offset, size))),
816+
));
817+
}
818+
drop(global); // don't hold that reference any longer than we have to
819+
820+
let Some((alloc_id, base_offset, orig_tag)) = loc else {
821+
return Ok(())
822+
};
823+
824+
// The SB history tracking needs a parent tag, so skip if we come from a wildcard.
811825
let SbTagExtra::Concrete(orig_tag) = orig_tag else {
812826
// FIXME: should we log this?
813827
return Ok(())
814828
};
829+
815830
let extra = this.get_alloc_extra(alloc_id)?;
816831
let mut stacked_borrows = extra
817832
.stacked_borrows
@@ -846,14 +861,15 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
846861
// Dangling slices are a common case here; it's valid to get their length but with raw
847862
// pointer tagging for example all calls to get_unchecked on them are invalid.
848863
if let Ok((alloc_id, base_offset, orig_tag)) = this.ptr_try_get_alloc_id(place.ptr) {
849-
log_creation(this, current_span, alloc_id, base_offset, orig_tag)?;
864+
log_creation(this, current_span, Some((alloc_id, base_offset, orig_tag)))?;
850865
return Ok(Some(alloc_id));
851866
}
852867
// This pointer doesn't come with an AllocId. :shrug:
868+
log_creation(this, current_span, None)?;
853869
return Ok(None);
854870
}
855871
let (alloc_id, base_offset, orig_tag) = this.ptr_get_alloc_id(place.ptr)?;
856-
log_creation(this, current_span, alloc_id, base_offset, orig_tag)?;
872+
log_creation(this, current_span, Some((alloc_id, base_offset, orig_tag)))?;
857873

858874
// Ensure we bail out if the pointer goes out-of-bounds (see miri#1050).
859875
let (alloc_size, _) = this.get_live_alloc_size_and_align(alloc_id)?;

tests/fail/alloc/deallocate-bad-alignment.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | unsafe { __rust_dealloc(ptr, layout.size(), layout.align()) }
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
9-
9+
= note: backtrace:
1010
= note: inside `std::alloc::dealloc` at RUSTLIB/alloc/src/alloc.rs:LL:CC
1111
note: inside `main` at $DIR/deallocate-bad-alignment.rs:LL:CC
1212
--> $DIR/deallocate-bad-alignment.rs:LL:CC

tests/fail/alloc/deallocate-bad-size.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | unsafe { __rust_dealloc(ptr, layout.size(), layout.align()) }
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
9-
9+
= note: backtrace:
1010
= note: inside `std::alloc::dealloc` at RUSTLIB/alloc/src/alloc.rs:LL:CC
1111
note: inside `main` at $DIR/deallocate-bad-size.rs:LL:CC
1212
--> $DIR/deallocate-bad-size.rs:LL:CC

tests/fail/alloc/deallocate-twice.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | unsafe { __rust_dealloc(ptr, layout.size(), layout.align()) }
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
9-
9+
= note: backtrace:
1010
= note: inside `std::alloc::dealloc` at RUSTLIB/alloc/src/alloc.rs:LL:CC
1111
note: inside `main` at $DIR/deallocate-twice.rs:LL:CC
1212
--> $DIR/deallocate-twice.rs:LL:CC

tests/fail/alloc/global_system_mixup.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | FREE();
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
9-
9+
= note: backtrace:
1010
= note: inside `std::sys::PLATFORM::alloc::<impl std::alloc::GlobalAlloc for std::alloc::System>::dealloc` at RUSTLIB/std/src/sys/PLATFORM/alloc.rs:LL:CC
1111
= note: inside `<std::alloc::System as std::alloc::Allocator>::deallocate` at RUSTLIB/std/src/alloc.rs:LL:CC
1212
note: inside `main` at $DIR/global_system_mixup.rs:LL:CC

tests/fail/alloc/no_global_allocator.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | __rust_alloc(1, 1);
55
| ^^^^^^^^^^^^^^^^^^ can't call foreign function: __rust_alloc
66
|
77
= help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
8-
8+
= note: backtrace:
99
= note: inside `start` at $DIR/no_global_allocator.rs:LL:CC
1010

1111
error: aborting due to previous error

tests/fail/alloc/reallocate-bad-size.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | unsafe { __rust_realloc(ptr, layout.size(), layout.align(), new_size) }
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
9-
9+
= note: backtrace:
1010
= note: inside `std::alloc::realloc` at RUSTLIB/alloc/src/alloc.rs:LL:CC
1111
note: inside `main` at $DIR/reallocate-bad-size.rs:LL:CC
1212
--> $DIR/reallocate-bad-size.rs:LL:CC

tests/fail/alloc/reallocate-change-alloc.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | let _z = *x;
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
9-
9+
= note: backtrace:
1010
= note: inside `main` at $DIR/reallocate-change-alloc.rs:LL:CC
1111

1212
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

tests/fail/alloc/reallocate-dangling.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | unsafe { __rust_realloc(ptr, layout.size(), layout.align(), new_size) }
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
9-
9+
= note: backtrace:
1010
= note: inside `std::alloc::realloc` at RUSTLIB/alloc/src/alloc.rs:LL:CC
1111
note: inside `main` at $DIR/reallocate-dangling.rs:LL:CC
1212
--> $DIR/reallocate-dangling.rs:LL:CC

tests/fail/alloc/stack_free.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | unsafe { __rust_dealloc(ptr, layout.size(), layout.align()) }
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
9-
9+
= note: backtrace:
1010
= note: inside `std::alloc::dealloc` at RUSTLIB/alloc/src/alloc.rs:LL:CC
1111
= note: inside `<std::alloc::Global as std::alloc::Allocator>::deallocate` at RUSTLIB/alloc/src/alloc.rs:LL:CC
1212
= note: inside `alloc::alloc::box_free::<i32, std::alloc::Global>` at RUSTLIB/alloc/src/alloc.rs:LL:CC

tests/fail/backtrace/bad-backtrace-decl.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | ... miri_resolve_frame(*frame, 0);
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
9-
9+
= note: backtrace:
1010
= note: inside `main` at $DIR/bad-backtrace-decl.rs:LL:CC
1111

1212
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

tests/fail/backtrace/bad-backtrace-flags.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | miri_get_backtrace(2, std::ptr::null_mut());
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unknown `miri_get_backtrace` flags 2
66
|
77
= help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
8-
8+
= note: backtrace:
99
= note: inside `main` at $DIR/bad-backtrace-flags.rs:LL:CC
1010

1111
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

tests/fail/backtrace/bad-backtrace-ptr.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | miri_resolve_frame(std::ptr::null_mut(), 0);
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
9-
9+
= note: backtrace:
1010
= note: inside `main` at $DIR/bad-backtrace-ptr.rs:LL:CC
1111

1212
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

tests/fail/backtrace/bad-backtrace-resolve-flags.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | miri_resolve_frame(buf[0], 2);
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unknown `miri_resolve_frame` flags 2
66
|
77
= help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
8-
8+
= note: backtrace:
99
= note: inside `main` at $DIR/bad-backtrace-resolve-flags.rs:LL:CC
1010

1111
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

tests/fail/backtrace/bad-backtrace-resolve-names-flags.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | ... miri_resolve_frame_names(buf[0], 2, std::ptr::null_mut(), std::ptr::n
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unknown `miri_resolve_frame_names` flags 2
66
|
77
= help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
8-
8+
= note: backtrace:
99
= note: inside `main` at $DIR/bad-backtrace-resolve-names-flags.rs:LL:CC
1010

1111
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

tests/fail/backtrace/bad-backtrace-size-flags.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | miri_backtrace_size(2);
55
| ^^^^^^^^^^^^^^^^^^^^^^ unknown `miri_backtrace_size` flags 2
66
|
77
= help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support
8-
8+
= note: backtrace:
99
= note: inside `main` at $DIR/bad-backtrace-size-flags.rs:LL:CC
1010

1111
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

tests/fail/box-cell-alias.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ help: <TAG> was later invalidated at offsets [0x0..0x1]
1919
|
2020
LL | let res = helper(val, ptr);
2121
| ^^^
22+
= note: backtrace:
2223
= note: inside `helper` at $DIR/box-cell-alias.rs:LL:CC
2324
note: inside `main` at $DIR/box-cell-alias.rs:LL:CC
2425
--> $DIR/box-cell-alias.rs:LL:CC

tests/fail/branchless-select-i128-pointer.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | | )
1010
|
1111
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
1212
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
13-
13+
= note: backtrace:
1414
= note: inside `main` at $DIR/branchless-select-i128-pointer.rs:LL:CC
1515

1616
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

tests/fail/concurrency/libc_pthread_join_detached.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | ... assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0);
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
9-
9+
= note: backtrace:
1010
= note: inside `main` at $DIR/libc_pthread_join_detached.rs:LL:CC
1111

1212
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

tests/fail/concurrency/libc_pthread_join_joined.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | ... assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0);
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
9-
9+
= note: backtrace:
1010
= note: inside `main` at $DIR/libc_pthread_join_joined.rs:LL:CC
1111

1212
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

tests/fail/concurrency/libc_pthread_join_main.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | ... assert_eq!(libc::pthread_join(thread_id, ptr::null_mut()), 0);
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
9-
9+
= note: backtrace:
1010
= note: inside closure at $DIR/libc_pthread_join_main.rs:LL:CC
1111

1212
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

tests/fail/concurrency/libc_pthread_join_multiple.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | ... assert_eq!(libc::pthread_join(native_copy, ptr::null_mut()), 0);
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
9-
9+
= note: backtrace:
1010
= note: inside closure at $DIR/libc_pthread_join_multiple.rs:LL:CC
1111

1212
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

tests/fail/concurrency/libc_pthread_join_self.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | assert_eq!(libc::pthread_join(native, ptr::null_mut()), 0);
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
9-
9+
= note: backtrace:
1010
= note: inside closure at $DIR/libc_pthread_join_self.rs:LL:CC
1111

1212
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

tests/fail/concurrency/thread_local_static_dealloc.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | let _val = *dangling_ptr.0;
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
9-
9+
= note: backtrace:
1010
= note: inside `main` at $DIR/thread_local_static_dealloc.rs:LL:CC
1111

1212
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace

tests/fail/concurrency/too_few_args.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | panic!()
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
9-
9+
= note: backtrace:
1010
= note: inside `thread_start` at RUSTLIB/std/src/panic.rs:LL:CC
1111
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
1212

tests/fail/concurrency/too_many_args.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | panic!()
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
9-
9+
= note: backtrace:
1010
= note: inside `thread_start` at RUSTLIB/std/src/panic.rs:LL:CC
1111
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
1212

tests/fail/concurrency/unwind_top_of_stack.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ LL | | }
1111
|
1212
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
1313
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
14-
14+
= note: backtrace:
1515
= note: inside `thread_start` at $DIR/unwind_top_of_stack.rs:LL:CC
1616

1717
error: aborting due to previous error

tests/fail/dangling_pointers/dangling_pointer_addr_of.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | let x = unsafe { ptr::addr_of!(*p) };
66
|
77
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
9-
9+
= note: backtrace:
1010
= note: inside `main` at RUSTLIB/core/src/ptr/mod.rs:LL:CC
1111
= note: this error originates in the macro `ptr::addr_of` (in Nightly builds, run with -Z macro-backtrace for more info)
1212

0 commit comments

Comments
 (0)