diff --git a/src/librustc_typeck/check/intrinsic.rs b/src/librustc_typeck/check/intrinsic.rs index 8a53c59b4c7fa..9051b1c8069bd 100644 --- a/src/librustc_typeck/check/intrinsic.rs +++ b/src/librustc_typeck/check/intrinsic.rs @@ -97,8 +97,10 @@ pub fn check_intrinsic_type(ccx: &CrateCtxt, it: &hir::ForeignItem) { (0, Vec::new(), tcx.mk_nil()) } op => { - span_err!(tcx.sess, it.span, E0092, - "unrecognized atomic operation function: `{}`", op); + struct_span_err!(tcx.sess, it.span, E0092, + "unrecognized atomic operation function: `{}`", op) + .span_label(it.span, &format!("unrecognized atomic operation")) + .emit(); return; } }; diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 609ba31bae0d7..36fdba3706109 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -4648,9 +4648,11 @@ pub fn check_bounds_are_used<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>, for (i, b) in tps_used.iter().enumerate() { if !*b { - span_err!(ccx.tcx.sess, tps[i].span, E0091, + struct_span_err!(ccx.tcx.sess, tps[i].span, E0091, "type parameter `{}` is unused", - tps[i].name); + tps[i].name) + .span_label(tps[i].span, &format!("unused type parameter")) + .emit(); } } } diff --git a/src/test/compile-fail/E0091.rs b/src/test/compile-fail/E0091.rs index da988dbf819ac..0d6c246de2a0e 100644 --- a/src/test/compile-fail/E0091.rs +++ b/src/test/compile-fail/E0091.rs @@ -9,7 +9,9 @@ // except according to those terms. type Foo = u32; //~ ERROR E0091 + //~| NOTE unused type parameter type Foo2 = Box; //~ ERROR E0091 + //~| NOTE unused type parameter fn main() { } diff --git a/src/test/compile-fail/E0092.rs b/src/test/compile-fail/E0092.rs index b08164ac06d42..c8bb31a7857ee 100644 --- a/src/test/compile-fail/E0092.rs +++ b/src/test/compile-fail/E0092.rs @@ -11,7 +11,7 @@ #![feature(intrinsics)] extern "rust-intrinsic" { fn atomic_foo(); //~ ERROR E0092 -} +} //~| NOTE unrecognized atomic operation fn main() { }