Update error messages for E0091 and E0092

This commit is contained in:
Stephen Lazaro 2016-08-08 14:10:09 -07:00
parent 1744c46e47
commit 156c822ab2
3 changed files with 10 additions and 4 deletions

View File

@ -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;
}
};

View File

@ -4637,9 +4637,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();
}
}
}

View File

@ -9,7 +9,9 @@
// except according to those terms.
type Foo<T> = u32; //~ ERROR E0091
//~| NOTE unused type parameter
type Foo2<A, B> = Box<A>; //~ ERROR E0091
//~| NOTE unused type parameter
fn main() {
}