Skip to content

Commit d3a6ea5

Browse files
committed
Update compiler error E0076 to use new error format
Fixes rust-lang#35221 part of rust-lang#35233
1 parent 6b74503 commit d3a6ea5

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/librustc_typeck/check/mod.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,9 @@ pub fn check_simd<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, sp: Span, id: ast::Node
12281228
}
12291229
let e = fields[0].ty(tcx, substs);
12301230
if !fields.iter().all(|f| f.ty(tcx, substs) == e) {
1231-
span_err!(tcx.sess, sp, E0076, "SIMD vector should be homogeneous");
1231+
struct_span_err!(tcx.sess, sp, E0076, "SIMD vector should be homogeneous")
1232+
.span_label(sp, &format!("SIMD elements must have the same type"))
1233+
.emit();
12321234
return;
12331235
}
12341236
match e.sty {

src/test/compile-fail/E0076.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
#![feature(repr_simd)]
1212

1313
#[repr(simd)]
14-
struct Bad(u16, u32, u32); //~ ERROR E0076
14+
struct Bad(u16, u32, u32);
15+
//~^ ERROR E0076
16+
//~| NOTE SIMD elements must have the same type
1517

1618
fn main() {
1719
}

0 commit comments

Comments
 (0)