Updated E0423 to new format
This commit is contained in:
parent
a4c6307a15
commit
8fdc531446
@ -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,
|
||||
|
@ -12,4 +12,5 @@ fn main () {
|
||||
struct Foo { a: bool };
|
||||
|
||||
let f = Foo(); //~ ERROR E0423
|
||||
//~^ struct called like a function
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user