Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Error Format for E0091 and E0092 #35528

Merged
merged 2 commits into from
Aug 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -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();
}
}
}
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() {
}