Skip to content

Commit

Permalink
Updated E0422 to new error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Knight committed Aug 16, 2016
1 parent e25542c commit d2e7895
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,13 @@ fn resolve_struct_error<'b, 'a: 'b, 'c>(resolver: &'b Resolver<'a>,
err
}
ResolutionError::DoesNotNameAStruct(name) => {
struct_span_err!(resolver.session,
let mut err = struct_span_err!(resolver.session,
span,
E0422,
"`{}` does not name a structure",
name)
name);
err.span_label(span, &format!("not a structure"));
err
}
ResolutionError::StructVariantUsedAsFunction(path_name) => {
struct_span_err!(resolver.session,
Expand Down
4 changes: 3 additions & 1 deletion src/test/compile-fail/E0422.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@
// except according to those terms.

fn main () {
let x = Foo { x: 1, y: 2 }; //~ ERROR E0422
let x = Foo { x: 1, y: 2 };
//~^ ERROR E0422
//~| NOTE not a structure
}

0 comments on commit d2e7895

Please sign in to comment.