about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFran Guijarro <franleplant@gmail.com>2016-08-06 22:17:35 -0300
committerFran Guijarro <franleplant@gmail.com>2016-08-07 12:03:29 -0300
commitda86ae23380f1085da02625459c586cf445ea503 (patch)
tree859fdeeb945b733eaebc334e6b5b8a2cb7a894d1
parent444ff9fbfb1f2a8e6645f67684f8a9ad99b343d3 (diff)
downloadrust-da86ae23380f1085da02625459c586cf445ea503.tar.gz
rust-da86ae23380f1085da02625459c586cf445ea503.zip
Update E0101 and E0102 to new format
-rw-r--r--src/librustc_typeck/check/writeback.rs14
-rw-r--r--src/test/compile-fail/E0101.rs4
-rw-r--r--src/test/compile-fail/E0102.rs4
3 files changed, 16 insertions, 6 deletions
diff --git a/src/librustc_typeck/check/writeback.rs b/src/librustc_typeck/check/writeback.rs
index 9786132dc53..42893e40024 100644
--- a/src/librustc_typeck/check/writeback.rs
+++ b/src/librustc_typeck/check/writeback.rs
@@ -441,13 +441,19 @@ impl<'cx, 'gcx, 'tcx> Resolver<'cx, 'gcx, 'tcx> {
         if !self.tcx.sess.has_errors() {
             match self.reason {
                 ResolvingExpr(span) => {
-                    span_err!(self.tcx.sess, span, E0101,
-                        "cannot determine a type for this expression: {}", e);
+                    struct_span_err!(
+                        self.tcx.sess, span, E0101,
+                        "cannot determine a type for this expression: {}", e)
+                        .span_label(span, &format!("cannot resolve type of expression"))
+                        .emit();
                 }
 
                 ResolvingLocal(span) => {
-                    span_err!(self.tcx.sess, span, E0102,
-                        "cannot determine a type for this local variable: {}", e);
+                    struct_span_err!(
+                        self.tcx.sess, span, E0102,
+                        "cannot determine a type for this local variable: {}", e)
+                        .span_label(span, &format!("cannot resolve type of variable"))
+                        .emit();
                 }
 
                 ResolvingPattern(span) => {
diff --git a/src/test/compile-fail/E0101.rs b/src/test/compile-fail/E0101.rs
index 7651626d44f..0005da048e4 100644
--- a/src/test/compile-fail/E0101.rs
+++ b/src/test/compile-fail/E0101.rs
@@ -9,5 +9,7 @@
 // except according to those terms.
 
 fn main() {
-    let x = |_| {}; //~ ERROR E0101
+    let x = |_| {};
+    //~^ ERROR E0101
+    //~| NOTE cannot resolve type of expression
 }
diff --git a/src/test/compile-fail/E0102.rs b/src/test/compile-fail/E0102.rs
index c4ddbab3e86..1d64798bb83 100644
--- a/src/test/compile-fail/E0102.rs
+++ b/src/test/compile-fail/E0102.rs
@@ -9,5 +9,7 @@
 // except according to those terms.
 
 fn main() {
-    let x = []; //~ ERROR E0102
+    let x = [];
+    //~^ ERROR E0102
+    //~| NOTE cannot resolve type of variable
 }