]> git.lizzy.rs Git - rust.git/commitdiff
Update error message for E0084
authorpliniker <peter.liniker+github@gmail.com>
Thu, 18 Aug 2016 20:27:33 +0000 (16:27 -0400)
committerpliniker <peter.liniker+github@gmail.com>
Thu, 18 Aug 2016 20:27:33 +0000 (16:27 -0400)
src/librustc_typeck/check/mod.rs
src/test/compile-fail/E0084.rs

index ff0b86aa595408da4eee1a88f87b53205eea7dfd..78d311865aa8720b5ade9d7678a1c19db3d8658f 100644 (file)
@@ -1245,8 +1245,11 @@ pub fn check_enum_variants<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>,
     let hint = *ccx.tcx.lookup_repr_hints(def_id).get(0).unwrap_or(&attr::ReprAny);
 
     if hint != attr::ReprAny && vs.is_empty() {
-        span_err!(ccx.tcx.sess, sp, E0084,
-            "unsupported representation for zero-variant enum");
+        struct_span_err!(
+            ccx.tcx.sess, sp, E0084,
+            "unsupported representation for zero-variant enum")
+            .span_label(sp, &format!("unsupported enum representation"))
+            .emit();
     }
 
     let repr_type_ty = ccx.tcx.enum_repr_type(Some(&hint)).to_ty(ccx.tcx);
index c579101325f5de2d49fef02dd2510f4a2b3a2d06..c7c5662f1feda8978b60d148d2f338e76fdf0728 100644 (file)
@@ -9,7 +9,9 @@
 // except according to those terms.
 
 #[repr(i32)]
-enum Foo {} //~ ERROR E0084
+enum Foo {}
+//~^ ERROR E0084
+//~| unsupported enum representation
 
 fn main() {
 }