Skip to content

Commit 8997db2

Browse files
committed
paper over platform differences
1 parent 9a44874 commit 8997db2

12 files changed

+30
-18
lines changed

tests/compile-fail/alloc/global_system_mixup.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// error-pattern: which is Rust heap memory, using
44

55
// normalize-stderr-test: "using [A-Za-z]+ heap deallocation operation" -> "using PLATFORM heap deallocation operation"
6+
// normalize-stderr-test: "\| +\^+" -> "| ^"
7+
// normalize-stderr-test: "libc::free\([^()]*\)|unsafe \{ HeapFree\([^()]*\) \};" -> "FREE();"
68

79
#![feature(allocator_api, slice_ptr_get)]
810

tests/compile-fail/alloc/global_system_mixup.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: Undefined Behavior: deallocating ALLOC, which is Rust heap memory, using PLATFORM heap deallocation operation
22
--> RUSTLIB/std/src/sys/PLATFORM/alloc.rs:LL:CC
33
|
4-
LL | libc::free(ptr as *mut libc::c_void)
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ deallocating ALLOC, which is Rust heap memory, using PLATFORM heap deallocation operation
4+
LL | FREE();
5+
| ^ deallocating ALLOC, which is Rust heap memory, using PLATFORM heap deallocation operation
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
@@ -13,7 +13,7 @@ note: inside `main` at $DIR/global_system_mixup.rs:LL:CC
1313
--> $DIR/global_system_mixup.rs:LL:CC
1414
|
1515
LL | unsafe { System.deallocate(ptr, l); }
16-
| ^^^^^^^^^^^^^^^^^^^^^^^^^
16+
| ^
1717

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

tests/compile-fail/panic/double_panic.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// error-pattern: the program aborted
2+
// normalize-stderr-test: "\| +\^+" -> "| ^"
3+
// normalize-stderr-test: "unsafe \{ libc::abort\(\) \}|crate::intrinsics::abort\(\);" -> "ABORT();"
24

35
struct Foo;
46
impl Drop for Foo {

tests/compile-fail/panic/double_panic.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ thread panicked while panicking. aborting.
6868
error: abnormal termination: the program aborted execution
6969
--> RUSTLIB/std/src/sys/PLATFORM/mod.rs:LL:CC
7070
|
71-
LL | unsafe { libc::abort() }
72-
| ^^^^^^^^^^^^^ the program aborted execution
71+
LL | ABORT();
72+
| ^ the program aborted execution
7373
|
7474
= note: inside `std::sys::PLATFORM::abort_internal` at RUSTLIB/std/src/sys/PLATFORM/mod.rs:LL:CC
7575
= note: inside `std::panicking::rust_panic_with_hook` at RUSTLIB/std/src/panicking.rs:LL:CC
@@ -80,7 +80,7 @@ note: inside `<Foo as std::ops::Drop>::drop` at RUSTLIB/std/src/panic.rs:LL:CC
8080
--> $DIR/double_panic.rs:LL:CC
8181
|
8282
LL | panic!("second");
83-
| ^^^^^^^^^^^^^^^^
83+
| ^
8484
= note: inside `std::ptr::drop_in_place::<Foo> - shim(Some(Foo))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC
8585
note: inside `main` at $DIR/double_panic.rs:LL:CC
8686
--> $DIR/double_panic.rs:LL:CC

tests/compile-fail/panic/panic_abort1.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// error-pattern: the program aborted execution
2+
// normalize-stderr-test: "\| +\^+" -> "| ^"
3+
// normalize-stderr-test: "libc::abort\(\);|core::intrinsics::abort\(\);" -> "ABORT();"
24
// compile-flags: -C panic=abort
35

46
fn main() {

tests/compile-fail/panic/panic_abort1.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
33
error: abnormal termination: the program aborted execution
44
--> RUSTLIB/panic_abort/src/lib.rs:LL:CC
55
|
6-
LL | libc::abort();
7-
| ^^^^^^^^^^^^^ the program aborted execution
6+
LL | ABORT();
7+
| ^ the program aborted execution
88
|
99
= note: inside `panic_abort::__rust_start_panic::abort` at RUSTLIB/panic_abort/src/lib.rs:LL:CC
1010
= note: inside `panic_abort::__rust_start_panic` at RUSTLIB/panic_abort/src/lib.rs:LL:CC
@@ -17,7 +17,7 @@ note: inside `main` at RUSTLIB/std/src/panic.rs:LL:CC
1717
--> $DIR/panic_abort1.rs:LL:CC
1818
|
1919
LL | std::panic!("panicking from libstd");
20-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20+
| ^
2121
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
2222

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

tests/compile-fail/panic/panic_abort2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// error-pattern: the program aborted execution
2+
// normalize-stderr-test: "\| +\^+" -> "| ^"
3+
// normalize-stderr-test: "libc::abort\(\);|core::intrinsics::abort\(\);" -> "ABORT();"
24
// compile-flags: -C panic=abort
35

46
fn main() {

tests/compile-fail/panic/panic_abort2.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
33
error: abnormal termination: the program aborted execution
44
--> RUSTLIB/panic_abort/src/lib.rs:LL:CC
55
|
6-
LL | libc::abort();
7-
| ^^^^^^^^^^^^^ the program aborted execution
6+
LL | ABORT();
7+
| ^ the program aborted execution
88
|
99
= note: inside `panic_abort::__rust_start_panic::abort` at RUSTLIB/panic_abort/src/lib.rs:LL:CC
1010
= note: inside `panic_abort::__rust_start_panic` at RUSTLIB/panic_abort/src/lib.rs:LL:CC
@@ -18,7 +18,7 @@ note: inside `main` at RUSTLIB/std/src/panic.rs:LL:CC
1818
--> $DIR/panic_abort2.rs:LL:CC
1919
|
2020
LL | std::panic!("{}-panicking from libstd", 42);
21-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21+
| ^
2222
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
2323

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

tests/compile-fail/panic/panic_abort3.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// error-pattern: the program aborted execution
2+
// normalize-stderr-test: "\| +\^+" -> "| ^"
3+
// normalize-stderr-test: "libc::abort\(\);|core::intrinsics::abort\(\);" -> "ABORT();"
24
// compile-flags: -C panic=abort
35

46
fn main() {

tests/compile-fail/panic/panic_abort3.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
33
error: abnormal termination: the program aborted execution
44
--> RUSTLIB/panic_abort/src/lib.rs:LL:CC
55
|
6-
LL | libc::abort();
7-
| ^^^^^^^^^^^^^ the program aborted execution
6+
LL | ABORT();
7+
| ^ the program aborted execution
88
|
99
= note: inside `panic_abort::__rust_start_panic::abort` at RUSTLIB/panic_abort/src/lib.rs:LL:CC
1010
= note: inside `panic_abort::__rust_start_panic` at RUSTLIB/panic_abort/src/lib.rs:LL:CC
@@ -19,7 +19,7 @@ note: inside `main` at RUSTLIB/core/src/panic.rs:LL:CC
1919
--> $DIR/panic_abort3.rs:LL:CC
2020
|
2121
LL | core::panic!("panicking from libcore");
22-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22+
| ^
2323
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
2424

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

tests/compile-fail/panic/panic_abort4.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// error-pattern: the program aborted execution
2+
// normalize-stderr-test: "\| +\^+" -> "| ^"
3+
// normalize-stderr-test: "libc::abort\(\);|core::intrinsics::abort\(\);" -> "ABORT();"
24
// compile-flags: -C panic=abort
35

46
fn main() {

tests/compile-fail/panic/panic_abort4.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
33
error: abnormal termination: the program aborted execution
44
--> RUSTLIB/panic_abort/src/lib.rs:LL:CC
55
|
6-
LL | libc::abort();
7-
| ^^^^^^^^^^^^^ the program aborted execution
6+
LL | ABORT();
7+
| ^ the program aborted execution
88
|
99
= note: inside `panic_abort::__rust_start_panic::abort` at RUSTLIB/panic_abort/src/lib.rs:LL:CC
1010
= note: inside `panic_abort::__rust_start_panic` at RUSTLIB/panic_abort/src/lib.rs:LL:CC
@@ -18,7 +18,7 @@ note: inside `main` at RUSTLIB/core/src/panic.rs:LL:CC
1818
--> $DIR/panic_abort4.rs:LL:CC
1919
|
2020
LL | core::panic!("{}-panicking from libcore", 42);
21-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21+
| ^
2222
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
2323

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

0 commit comments

Comments
 (0)