about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAbhishek Kumar <kr11.abhishek@gmail.com>2016-08-28 01:12:54 +0530
committerAbhishek Kumar <kr11.abhishek@gmail.com>2016-08-31 02:05:48 +0530
commitd3a6ea52d750499abfaed307cee519879ecbb4c9 (patch)
tree5d22cb90be783e86b689d4f9b0a3b9b21a20fe03
parent6b74503aa4f2fb4035d9adef9391e9b9658c57ad (diff)
downloadrust-d3a6ea52d750499abfaed307cee519879ecbb4c9.tar.gz
rust-d3a6ea52d750499abfaed307cee519879ecbb4c9.zip
Update compiler error E0076 to use new error format
Fixes #35221 part of #35233
-rw-r--r--src/librustc_typeck/check/mod.rs4
-rw-r--r--src/test/compile-fail/E0076.rs4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs
index 16300d869ab..bd52967e72a 100644
--- a/src/librustc_typeck/check/mod.rs
+++ b/src/librustc_typeck/check/mod.rs
@@ -1228,7 +1228,9 @@ pub fn check_simd<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, sp: Span, id: ast::Node
             }
             let e = fields[0].ty(tcx, substs);
             if !fields.iter().all(|f| f.ty(tcx, substs) == e) {
-                span_err!(tcx.sess, sp, E0076, "SIMD vector should be homogeneous");
+                struct_span_err!(tcx.sess, sp, E0076, "SIMD vector should be homogeneous")
+                                .span_label(sp, &format!("SIMD elements must have the same type"))
+                                .emit();
                 return;
             }
             match e.sty {
diff --git a/src/test/compile-fail/E0076.rs b/src/test/compile-fail/E0076.rs
index b0f02a03e00..c31dc62eb66 100644
--- a/src/test/compile-fail/E0076.rs
+++ b/src/test/compile-fail/E0076.rs
@@ -11,7 +11,9 @@
 #![feature(repr_simd)]
 
 #[repr(simd)]
-struct Bad(u16, u32, u32); //~ ERROR E0076
+struct Bad(u16, u32, u32);
+//~^ ERROR E0076
+//~| NOTE SIMD elements must have the same type
 
 fn main() {
 }