about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2016-05-27 21:57:06 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2016-05-27 21:57:06 +0200
commit4fa84830f8a91a2a8db988afec96b416ae2654c0 (patch)
tree82ccc69d61802e73b9b7ddebf2ff73d6151c5b4c
parent360d7234c7ce1392c2730fba2e7d9b33f3ff9e5f (diff)
downloadrust-4fa84830f8a91a2a8db988afec96b416ae2654c0.tar.gz
rust-4fa84830f8a91a2a8db988afec96b416ae2654c0.zip
improve E0152 error explanation
-rw-r--r--src/librustc/diagnostics.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/librustc/diagnostics.rs b/src/librustc/diagnostics.rs
index 7c350987aa1..a410a5949bd 100644
--- a/src/librustc/diagnostics.rs
+++ b/src/librustc/diagnostics.rs
@@ -525,6 +525,17 @@ call to `mem::forget(v)` in case you want to avoid destructors being called.
 "##,
 
 E0152: r##"
+A lang item was redefined.
+
+Erroneous code example:
+
+```compile_fail
+#![feature(lang_items)]
+
+#[lang = "panic_fmt"]
+struct Foo; // error: duplicate lang item found: `panic_fmt`
+```
+
 Lang items are already implemented in the standard library. Unless you are
 writing a free-standing application (e.g. a kernel), you do not need to provide
 them yourself.