Skip to content

Commit 015bcae

Browse files
committed
Auto merge of rust-lang#104449 - oli-obk:unhide_unknown_spans, r=estebank,RalfJung
Start emitting labels even if their pointed to file is not available locally r? `@estebank` cc `@RalfJung` fixes rust-lang#97699
2 parents 0208c4c + 3525e09 commit 015bcae

File tree

66 files changed

+82
-80
lines changed

Some content is hidden

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

66 files changed

+82
-80
lines changed

src/diagnostics.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,9 @@ fn report_msg<'tcx>(
364364
if is_local && idx > 0 {
365365
err.span_note(frame_info.span, &frame_info.to_string());
366366
} else {
367-
err.note(&frame_info.to_string());
367+
let sm = sess.source_map();
368+
let span = sm.span_to_embeddable_string(frame_info.span);
369+
err.note(format!("{frame_info} at {span}"));
368370
}
369371
}
370372

tests/fail/abort-terminator.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LL | | }
1010
| |_^ the program aborted execution
1111
|
1212
= note: inside `panic_abort` at $DIR/abort-terminator.rs:LL:CC
13-
note: inside `main` at $DIR/abort-terminator.rs:LL:CC
13+
note: inside `main`
1414
--> $DIR/abort-terminator.rs:LL:CC
1515
|
1616
LL | panic_abort();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | unsafe { __rust_dealloc(ptr, layout.size(), layout.align()) }
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
99
= note: BACKTRACE:
1010
= note: inside `std::alloc::dealloc` at RUSTLIB/alloc/src/alloc.rs:LL:CC
11-
note: inside `main` at $DIR/deallocate-bad-alignment.rs:LL:CC
11+
note: inside `main`
1212
--> $DIR/deallocate-bad-alignment.rs:LL:CC
1313
|
1414
LL | dealloc(x, Layout::from_size_align_unchecked(1, 2));

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | unsafe { __rust_dealloc(ptr, layout.size(), layout.align()) }
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
99
= note: BACKTRACE:
1010
= note: inside `std::alloc::dealloc` at RUSTLIB/alloc/src/alloc.rs:LL:CC
11-
note: inside `main` at $DIR/deallocate-bad-size.rs:LL:CC
11+
note: inside `main`
1212
--> $DIR/deallocate-bad-size.rs:LL:CC
1313
|
1414
LL | dealloc(x, Layout::from_size_align_unchecked(2, 1));

tests/fail/alloc/deallocate-twice.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | unsafe { __rust_dealloc(ptr, layout.size(), layout.align()) }
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
99
= note: BACKTRACE:
1010
= note: inside `std::alloc::dealloc` at RUSTLIB/alloc/src/alloc.rs:LL:CC
11-
note: inside `main` at $DIR/deallocate-twice.rs:LL:CC
11+
note: inside `main`
1212
--> $DIR/deallocate-twice.rs:LL:CC
1313
|
1414
LL | dealloc(x, Layout::from_size_align_unchecked(1, 1));

tests/fail/alloc/global_system_mixup.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LL | FREE();
99
= 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
12-
note: inside `main` at $DIR/global_system_mixup.rs:LL:CC
12+
note: inside `main`
1313
--> $DIR/global_system_mixup.rs:LL:CC
1414
|
1515
LL | System.deallocate(ptr, l);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | unsafe { __rust_realloc(ptr, layout.size(), layout.align(), new_size) }
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
99
= note: BACKTRACE:
1010
= note: inside `std::alloc::realloc` at RUSTLIB/alloc/src/alloc.rs:LL:CC
11-
note: inside `main` at $DIR/reallocate-bad-size.rs:LL:CC
11+
note: inside `main`
1212
--> $DIR/reallocate-bad-size.rs:LL:CC
1313
|
1414
LL | let _y = realloc(x, Layout::from_size_align_unchecked(2, 1), 1);

tests/fail/alloc/reallocate-dangling.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ LL | unsafe { __rust_realloc(ptr, layout.size(), layout.align(), new_size) }
88
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
99
= note: BACKTRACE:
1010
= note: inside `std::alloc::realloc` at RUSTLIB/alloc/src/alloc.rs:LL:CC
11-
note: inside `main` at $DIR/reallocate-dangling.rs:LL:CC
11+
note: inside `main`
1212
--> $DIR/reallocate-dangling.rs:LL:CC
1313
|
1414
LL | let _z = realloc(x, Layout::from_size_align_unchecked(1, 1), 1);

tests/fail/alloc/stack_free.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ LL | unsafe { __rust_dealloc(ptr, layout.size(), layout.align()) }
1212
= note: inside `alloc::alloc::box_free::<i32, std::alloc::Global>` at RUSTLIB/alloc/src/alloc.rs:LL:CC
1313
= note: inside `std::ptr::drop_in_place::<std::boxed::Box<i32>> - shim(Some(std::boxed::Box<i32>))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC
1414
= note: inside `std::mem::drop::<std::boxed::Box<i32>>` at RUSTLIB/core/src/mem/mod.rs:LL:CC
15-
note: inside `main` at $DIR/stack_free.rs:LL:CC
15+
note: inside `main`
1616
--> $DIR/stack_free.rs:LL:CC
1717
|
1818
LL | drop(bad_box);

tests/fail/box-cell-alias.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ LL | let res = helper(val, ptr);
2121
| ^^^
2222
= note: BACKTRACE:
2323
= note: inside `helper` at $DIR/box-cell-alias.rs:LL:CC
24-
note: inside `main` at $DIR/box-cell-alias.rs:LL:CC
24+
note: inside `main`
2525
--> $DIR/box-cell-alias.rs:LL:CC
2626
|
2727
LL | let res = helper(val, ptr);

0 commit comments

Comments
 (0)