Skip to content

Commit 4eb1868

Browse files
committed
Revert "deleted duplicate_entry_error.rs in favor of panic-handler/panic-handler-duplicate.rs"
This reverts commit ca3c094.
1 parent c9ee8a1 commit 4eb1868

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

tests/ui/duplicate_entry_error.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//@ normalize-stderr: "loaded from .*libstd-.*.rlib" -> "loaded from SYSROOT/libstd-*.rlib"
2+
// note-pattern: first defined in crate `std`.
3+
4+
// Test for issue #31788 and E0152
5+
6+
#![feature(lang_items)]
7+
8+
extern crate core;
9+
10+
use core::panic::PanicInfo;
11+
12+
#[lang = "panic_impl"]
13+
fn panic_impl(info: &PanicInfo) -> ! {
14+
//~^ ERROR: found duplicate lang item `panic_impl`
15+
loop {}
16+
}
17+
18+
fn main() {}

tests/ui/duplicate_entry_error.stderr

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
error[E0152]: found duplicate lang item `panic_impl`
2+
--> $DIR/duplicate_entry_error.rs:13:1
3+
|
4+
LL | / fn panic_impl(info: &PanicInfo) -> ! {
5+
LL | |
6+
LL | | loop {}
7+
LL | | }
8+
| |_^
9+
|
10+
= note: the lang item is first defined in crate `std` (which `duplicate_entry_error` depends on)
11+
= note: first definition in `std` loaded from SYSROOT/libstd-*.rlib
12+
= note: second definition in the local crate (`duplicate_entry_error`)
13+
14+
error: aborting due to 1 previous error
15+
16+
For more information about this error, try `rustc --explain E0152`.

0 commit comments

Comments
 (0)