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

Updated E0391 and E0404 to new error format #35359

Merged
merged 2 commits into from
Aug 5, 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
8 changes: 7 additions & 1 deletion src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,13 @@ fn resolve_struct_error<'b, 'a: 'b, 'c>(resolver: &'b Resolver<'a>,
name)
}
ResolutionError::IsNotATrait(name) => {
struct_span_err!(resolver.session, span, E0404, "`{}` is not a trait", name)
let mut err = struct_span_err!(resolver.session,
span,
E0404,
"`{}` is not a trait",
name);
err.span_label(span, &format!("not a trait"));
err
}
ResolutionError::UndeclaredTraitName(name, candidates) => {
let mut err = struct_span_err!(resolver.session,
Expand Down
1 change: 1 addition & 0 deletions src/librustc_typeck/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ impl<'a,'tcx> CrateCtxt<'a,'tcx> {

let mut err = struct_span_err!(tcx.sess, span, E0391,
"unsupported cyclic reference between types/traits detected");
err.span_label(span, &format!("cyclic reference"));

match cycle[0] {
AstConvRequest::GetItemTypeScheme(def_id) |
Expand Down
1 change: 1 addition & 0 deletions src/test/compile-fail/issue-3907.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ struct S {
}

impl Foo for S { //~ ERROR: `Foo` is not a trait
//~| NOTE: not a trait
//~| NOTE: type aliases cannot be used for traits
fn bar() { }
}
Expand Down
1 change: 1 addition & 0 deletions src/test/compile-fail/issue-5035.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
trait I {}
type K = I;
impl K for isize {} //~ ERROR: `K` is not a trait
//~| NOTE: not a trait
//~| NOTE: aliases cannot be used for traits

use ImportError; //~ ERROR unresolved
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/codemap_tests/two_files.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ error[E0404]: `Bar` is not a trait
--> $DIR/two_files.rs:16:6
|
16 | impl Bar for Baz { }
| ^^^
| ^^^ not a trait
|
= note: type aliases cannot be used for traits

Expand Down