From 67c11b0146d875260ffd7d44184221e42c01186c Mon Sep 17 00:00:00 2001
From: Guillaume Gomez <guillaume1.gomez@gmail.com>
Date: Fri, 19 Jun 2015 16:47:01 +0200
Subject: [PATCH] Add E0071 error explanation

---
 src/librustc_typeck/diagnostics.rs | 33 +++++++++++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs
index 59ddbc4f210..59c21f581ea 100644
--- a/src/librustc_typeck/diagnostics.rs
+++ b/src/librustc_typeck/diagnostics.rs
@@ -746,6 +746,38 @@ fn some_func(x: &mut i32) {
 ```
 "##,
 
+E0071: r##"
+You tried to use a structure initialization with a non-structure type.
+Example of erroneous code:
+
+```
+enum Foo { f };
+
+let u = Foo::f { value: 0i32 }; // error: Foo:f isn't a structure!
+// or even more simple:
+let u = t { random_field: 0i32 }; //error: t isn't a structure!
+```
+
+To fix this error, please declare the structure with the given name
+first:
+
+```
+struct Inner {
+    value: i32
+}
+
+enum Foo {
+    f(Inner)
+}
+
+fn main() {
+    let u = Foo::f(Inner { value: 0i32 });
+    // or even more simple:
+    let t = Inner { value: 0i32 };
+}
+```
+"##,
+
 E0072: r##"
 When defining a recursive struct or enum, any use of the type being defined
 from inside the definition must occur behind a pointer (like `Box` or `&`).
@@ -1505,7 +1537,6 @@ register_diagnostics! {
     E0035, // does not take type parameters
     E0036, // incorrect number of type parameters given for this method
     E0068,
-    E0071,
     E0074,
     E0075,
     E0076,