Skip to content

Commit 7ad493a

Browse files
author
Jonathan Turner
authored
Rollup merge of rust-lang#36050 - abhiQmar:e0076-formatting, r=jonathandturner
Update compiler error E0076 to use new error format Fixes rust-lang#35221 part of rust-lang#35233 r? @jonathandturner
2 parents 0c6edea + d3a6ea5 commit 7ad493a

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
@@ -1204,7 +1204,9 @@ pub fn check_simd<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, sp: Span, id: ast::Node
12041204
}
12051205
let e = fields[0].ty(tcx, substs);
12061206
if !fields.iter().all(|f| f.ty(tcx, substs) == e) {
1207-
span_err!(tcx.sess, sp, E0076, "SIMD vector should be homogeneous");
1207+
struct_span_err!(tcx.sess, sp, E0076, "SIMD vector should be homogeneous")
1208+
.span_label(sp, &format!("SIMD elements must have the same type"))
1209+
.emit();
12081210
return;
12091211
}
12101212
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)