Closed
Description
enum MyEnum {
A(i32),
B(u32),
}
fn use_enum(e: MyEnum) {
if let MyEnum::A(...) = e {
println!("got enum")
};
}
The problem here is that we have if let MyEnum::A(...) = e
instead of if let MyEnum::A(..) = e
The compiler however points towards )
in the error message instead of the superfluous .
:
error: unexpected token: `)`
--> src/main.rs:7:25
|
7 | if let MyEnum::A(...) = e {
| ^
error: aborting due to previous error
Fun fact: when using four dots MyEnum::A(....)
, it correctly points at the last dot :)
error: unexpected token: `.`
--> src/main.rs:7:25
|
7 | if let MyEnum::A(....) = e {
| ^
error: aborting due to previous error
This issue has been assigned to @rakshith-ravi via this comment.
Metadata
Metadata
Assignees
Labels
Area: Messages for errors, warnings, and lintsArea: The lexing & parsing of Rust source code to an ASTCategory: An issue proposing an enhancement or a PR with one.Diagnostics: An error or lint that needs small tweaks.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Relevant to the compiler team, which will review and decide on the PR/issue.