]> git.lizzy.rs Git - rust.git/commitdiff
Update compiler error E0076 to use new error format
authorAbhishek Kumar <kr11.abhishek@gmail.com>
Sat, 27 Aug 2016 19:42:54 +0000 (01:12 +0530)
committerAbhishek Kumar <kr11.abhishek@gmail.com>
Tue, 30 Aug 2016 20:35:48 +0000 (02:05 +0530)
Fixes #35221 part of #35233

src/librustc_typeck/check/mod.rs
src/test/compile-fail/E0076.rs

index 16300d869abf50ae87527a5e3d10d7aa01913301..bd52967e72a43957d76378f8bc07f85ebfd4a903 100644 (file)
@@ -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 {
index b0f02a03e00518c71850695e0a1e289aa36b4083..c31dc62eb666bc1b5961153eee5fa5cc98f245f0 100644 (file)
@@ -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() {
 }