about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJonathan Turner <jonathandturner@users.noreply.github.com>2016-08-08 13:25:58 -0700
committerGitHub <noreply@github.com>2016-08-08 13:25:58 -0700
commitbbbac59c2966eaa17d8d0fba3755cda081e6f4b2 (patch)
tree5608d7312f8832080468703691406dbd75c0468c
parent0e4e8e9544c986fe0e738e381f007714bf193ba5 (diff)
parenta848f11007e7cd44f816acb8128247d5d7a1359e (diff)
downloadrust-bbbac59c2966eaa17d8d0fba3755cda081e6f4b2.tar.gz
rust-bbbac59c2966eaa17d8d0fba3755cda081e6f4b2.zip
Rollup merge of #35475 - shyaamsundhar:patch-1, r=jonathandturner
E0248 New Format
-rw-r--r--src/librustc_typeck/astconv.rs8
-rw-r--r--src/test/compile-fail/E0248.rs2
2 files changed, 6 insertions, 4 deletions
diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs
index 3bc9b4b69c3..efefe848c69 100644
--- a/src/librustc_typeck/astconv.rs
+++ b/src/librustc_typeck/astconv.rs
@@ -1590,9 +1590,11 @@ impl<'o, 'gcx: 'tcx, 'tcx> AstConv<'gcx, 'tcx>+'o {
                 return self.tcx().types.err;
             }
             _ => {
-                span_err!(tcx.sess, span, E0248,
-                          "found value `{}` used as a type",
-                          tcx.item_path_str(def.def_id()));
+                struct_span_err!(tcx.sess, span, E0248,
+                           "found value `{}` used as a type",
+                            tcx.item_path_str(def.def_id()))
+                           .span_label(span, &format!("value used as a type"))
+                           .emit();
                 return self.tcx().types.err;
             }
         }
diff --git a/src/test/compile-fail/E0248.rs b/src/test/compile-fail/E0248.rs
index fdfd41a456b..25568a323e1 100644
--- a/src/test/compile-fail/E0248.rs
+++ b/src/test/compile-fail/E0248.rs
@@ -13,6 +13,6 @@ enum Foo {
 }
 
 fn do_something(x: Foo::Bar) { } //~ ERROR E0248
-
+                //~| NOTE value used as a type
 fn main() {
 }