mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-07 12:33:14 +00:00
Add test for duplicate lang items
This commit is contained in:
parent
a360ecd64b
commit
1f89e90073
10
tests/ui/lang-items/duplicate.rs
Normal file
10
tests/ui/lang-items/duplicate.rs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
// normalize-stderr-test "loaded from .*libcore-.*.rlib" -> "loaded from SYSROOT/libcore-*.rlib"
|
||||||
|
#![feature(lang_items)]
|
||||||
|
|
||||||
|
#[lang = "sized"]
|
||||||
|
trait Sized {}
|
||||||
|
//~^ ERROR: duplicate lang item
|
||||||
|
|
||||||
|
#[lang = "tuple_trait"]
|
||||||
|
pub trait Tuple {}
|
||||||
|
// no error
|
13
tests/ui/lang-items/duplicate.stderr
Normal file
13
tests/ui/lang-items/duplicate.stderr
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
error[E0152]: found duplicate lang item `sized`
|
||||||
|
--> $DIR/duplicate.rs:5:1
|
||||||
|
|
|
||||||
|
LL | trait Sized {}
|
||||||
|
| ^^^^^^^^^^^^^^
|
||||||
|
|
|
||||||
|
= note: the lang item is first defined in crate `core` (which `std` depends on)
|
||||||
|
= note: first definition in `core` loaded from SYSROOT/libcore-*.rlib
|
||||||
|
= note: second definition in the local crate (`duplicate`)
|
||||||
|
|
||||||
|
error: aborting due to 1 previous error
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0152`.
|
Loading…
Reference in New Issue
Block a user