about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2015-09-20 12:02:56 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2015-09-20 12:02:56 +0200
commit6e1c675ff084cf671aaa710f195b8498e1090f35 (patch)
treece0ec56e4f71570ed0b7b701b69ca0835f724c02
parent1adcfb8c13a2c224ae78178350de2e0fba8291c4 (diff)
downloadrust-6e1c675ff084cf671aaa710f195b8498e1090f35.tar.gz
rust-6e1c675ff084cf671aaa710f195b8498e1090f35.zip
Add error codes for librustc_typeck
-rw-r--r--src/librustc_typeck/check/mod.rs6
-rw-r--r--src/librustc_typeck/diagnostics.rs3
2 files changed, 5 insertions, 4 deletions
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs
index 51eee67df96..ba4f6e56405 100644
--- a/src/librustc_typeck/check/mod.rs
+++ b/src/librustc_typeck/check/mod.rs
@@ -1308,9 +1308,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         match self.inh.locals.borrow().get(&nid) {
             Some(&t) => t,
             None => {
-                self.tcx().sess.span_err(
-                    span,
-                    &format!("no type for local variable {}", nid));
+                span_err!(self.tcx().sess, span, E0513,
+                          "no type for local variable {}",
+                          nid);
                 self.tcx().types.err
             }
         }
diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs
index 78eaedfbd1b..1a5f9c9d7a8 100644
--- a/src/librustc_typeck/diagnostics.rs
+++ b/src/librustc_typeck/diagnostics.rs
@@ -3344,5 +3344,6 @@ register_diagnostics! {
            // type because its default value `{}` references the type `Self`"
     E0399, // trait items need to be implemented because the associated
            // type `{}` was overridden
-    E0436,  // functional record update requires a struct
+    E0436, // functional record update requires a struct
+    E0513, // no type for local variable ..
 }