Skip to content

Commit 0c2ef16

Browse files
Rollup merge of #157826 - tshepang:some-lack-a-personality, r=oli-obk
make test succeed on targets lacking a personality Not all targets have `eh_personality` lang item set (see library/std/src/sys/personality/mod.rs), so change test to use a more available lang item.
2 parents e7757c8 + 53ed851 commit 0c2ef16

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

tests/ui/error-codes/E0152-duplicate-lang-items.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
//!
44
//! Issue: <https://github.com/rust-lang/rust/issues/31788>
55
6-
//@ normalize-stderr: "loaded from .*libstd-.*.rmeta" -> "loaded from SYSROOT/libstd-*.rmeta"
6+
//@ normalize-stderr: "loaded from \$.*libcore-.*.rmeta" -> "loaded from SYSROOT/libcore-*.rmeta"
77
//@ dont-require-annotations: NOTE
88

99
#![feature(lang_items)]
1010

11-
#[lang = "eh_personality"]
12-
fn personality() {
13-
//~^ ERROR: found duplicate lang item `eh_personality`
14-
//~| NOTE first defined in crate `std`
11+
#[lang = "panic_fmt"]
12+
fn panic_fmt() -> ! {
13+
//~^ ERROR: found duplicate lang item `panic_fmt`
14+
//~| NOTE first defined in crate `core`
1515
loop {}
1616
}
1717

tests/ui/error-codes/E0152-duplicate-lang-items.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
error[E0152]: found duplicate lang item `eh_personality`
1+
error[E0152]: found duplicate lang item `panic_fmt`
22
--> $DIR/E0152-duplicate-lang-items.rs:12:1
33
|
4-
LL | / fn personality() {
4+
LL | / fn panic_fmt() -> ! {
55
LL | |
66
LL | |
77
LL | | loop {}
88
LL | | }
99
| |_^
1010
|
11-
= note: the lang item is first defined in crate `std` (which `E0152_duplicate_lang_items` depends on)
12-
= note: first definition in `std` loaded from SYSROOT/libstd-*.rmeta
11+
= note: the lang item is first defined in crate `core` (which `std` depends on)
12+
= note: first definition in `core` loaded from SYSROOT/libcore-*.rmeta
1313
= note: second definition in the local crate (`E0152_duplicate_lang_items`)
1414

1515
error: aborting due to 1 previous error

0 commit comments

Comments
 (0)