Skip to content

Use the proper term when using non-existing variant #46024

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

Merged
merged 4 commits into from
Nov 23, 2017
Merged
Changes from 1 commit
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
Prev Previous commit
Add test to new branches
  • Loading branch information
estebank committed Nov 23, 2017
commit b450aff18689ea0d0695b4f5a59bb360ae549f87
15 changes: 15 additions & 0 deletions src/test/compile-fail/issue-23173.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,26 @@

enum Token { LeftParen, RightParen, Plus, Minus, /* etc */ }
//~^ NOTE variant `Homura` not found here
struct Struct {
//~^ NOTE function or associated item `method` not found for this
//~| NOTE function or associated item `method` not found for this
//~| NOTE associated item `Assoc` not found for this
a: usize,
}

fn use_token(token: &Token) { unimplemented!() }

fn main() {
use_token(&Token::Homura);
//~^ ERROR no variant named `Homura`
//~| NOTE variant not found in `Token`
Struct::method();
//~^ ERROR no function or associated item named `method` found for type
//~| NOTE function or associated item not found in `Struct`
Struct::method;
//~^ ERROR no function or associated item named `method` found for type
//~| NOTE function or associated item not found in `Struct`
Struct::Assoc;
//~^ ERROR no associated item named `Assoc` found for type `Struct` in
//~| NOTE associated item not found in `Struct`
}