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.
The problem here is that we have
if let MyEnum::A(...) = einstead ofif let MyEnum::A(..) = eThe compiler however points towards
)in the error message instead of the superfluous.:Fun fact: when using four dots
MyEnum::A(....), it correctly points at the last dot :)This issue has been assigned to @rakshith-ravi via this comment.