Skip to content

Commit

Permalink
Rollup merge of rust-lang#36050 - abhiQmar:e0076-formatting, r=jonath…
Browse files Browse the repository at this point in the history
…andturner

Update compiler error E0076 to use new error format

Fixes rust-lang#35221 part of rust-lang#35233

r? @jonathandturner
  • Loading branch information
Jonathan Turner authored Aug 31, 2016
2 parents f749281 + d3a6ea5 commit 38a4007
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,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 {
Expand Down
4 changes: 3 additions & 1 deletion src/test/compile-fail/E0076.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
}

0 comments on commit 38a4007

Please sign in to comment.