Skip to content

Commit 4fa8483

Browse files
improve E0152 error explanation
1 parent 360d723 commit 4fa8483

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/librustc/diagnostics.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,17 @@ call to `mem::forget(v)` in case you want to avoid destructors being called.
525525
"##,
526526

527527
E0152: r##"
528+
A lang item was redefined.
529+
530+
Erroneous code example:
531+
532+
```compile_fail
533+
#![feature(lang_items)]
534+
535+
#[lang = "panic_fmt"]
536+
struct Foo; // error: duplicate lang item found: `panic_fmt`
537+
```
538+
528539
Lang items are already implemented in the standard library. Unless you are
529540
writing a free-standing application (e.g. a kernel), you do not need to provide
530541
them yourself.

0 commit comments

Comments
 (0)