Skip to content

Commit

Permalink
Rollup merge of rust-lang#35528 - Vassah:master, r=jonathandturner
Browse files Browse the repository at this point in the history
Update Error Format for E0091 and E0092

Addresses [rust-lang#35228](rust-lang#35228) and [rust-lang#35229](rust-lang#35229) as part of [rust-lang#35233](rust-lang#35233).

Please let me know if there are any issues; first time contributor.

r? @jonathandturner
  • Loading branch information
steveklabnik authored Aug 10, 2016
2 parents dddc8d5 + da8fed5 commit 5847faa
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/librustc_typeck/check/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
};
Expand Down
6 changes: 4 additions & 2 deletions src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}
2 changes: 2 additions & 0 deletions src/test/compile-fail/E0091.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
}
2 changes: 1 addition & 1 deletion src/test/compile-fail/E0092.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#![feature(intrinsics)]
extern "rust-intrinsic" {
fn atomic_foo(); //~ ERROR E0092
}
} //~| NOTE unrecognized atomic operation

fn main() {
}

0 comments on commit 5847faa

Please sign in to comment.