Skip to content

Commit

Permalink
Updated E0423 to new format
Browse files Browse the repository at this point in the history
  • Loading branch information
Knight committed Aug 22, 2016
1 parent a4c6307 commit 8fdc531
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/librustc_resolve/lib.rs
Expand Up @@ -336,12 +336,14 @@ fn resolve_struct_error<'b, 'a: 'b, 'c>(resolver: &'b Resolver<'a>,
err
}
ResolutionError::StructVariantUsedAsFunction(path_name) => {
struct_span_err!(resolver.session,
let mut err = struct_span_err!(resolver.session,
span,
E0423,
"`{}` is the name of a struct or struct variant, but this expression \
uses it like a function name",
path_name)
path_name);
err.span_label(span, &format!("struct called like a function"));
err
}
ResolutionError::SelfNotAvailableInStaticMethod => {
struct_span_err!(resolver.session,
Expand Down
1 change: 1 addition & 0 deletions src/test/compile-fail/E0423.rs
Expand Up @@ -12,4 +12,5 @@ fn main () {
struct Foo { a: bool };

let f = Foo(); //~ ERROR E0423
//~^ struct called like a function
}
4 changes: 3 additions & 1 deletion src/test/compile-fail/issue-18252.rs
Expand Up @@ -13,5 +13,7 @@ enum Foo {
}

fn main() {
let f = Foo::Variant(42); //~ ERROR uses it like a function
let f = Foo::Variant(42);
//~^ ERROR uses it like a function
//~| struct called like a function
}
4 changes: 3 additions & 1 deletion src/test/compile-fail/issue-19452.rs
Expand Up @@ -13,5 +13,7 @@ enum Homura {
}

fn main() {
let homura = Homura::Madoka; //~ ERROR uses it like a function
let homura = Homura::Madoka;
//~^ ERROR uses it like a function
//~| struct called like a function
}

0 comments on commit 8fdc531

Please sign in to comment.