]> git.lizzy.rs Git - rust.git/commitdiff
improve E0152 error explanation
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Fri, 27 May 2016 19:57:06 +0000 (21:57 +0200)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Fri, 27 May 2016 19:57:06 +0000 (21:57 +0200)
src/librustc/diagnostics.rs

index 7c350987aa1e82a5d002171dd5e643fa5dc112ec..a410a5949bdc851b5010c61ee80198c70de51b9d 100644 (file)
@@ -525,6 +525,17 @@ fn foo<T: MyTransmutableType>(x: Vec<T>) {
 "##,
 
 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.