You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pubenumRepro{A(i64),B(i64),}fnmake(a:bool,data:i64) -> Repro{(match a {true => Repro::A,false => Repro::B,}(data))}
Issue
When I write my code as suggested, I get a warning for putting parenthesis around this match statement:
However, upon doing what the warning says, I am then greeted with a compiler error (the error persists if I put the parenthesis next to the closing brace of the match statement, as expected)
Misc
Apologies if this is in the wrong repository. Not sure if it should go to clippy, or to rust as this seems like some sort of parser oversight.
The text was updated successfully, but these errors were encountered:
monoclex
changed the title
unnecessary_parens false positive when calling functionunnecessary_parens false positive when calling function from match
Oct 31, 2021
Both the warning and the error come from rustc (the rust compiler), so I would suggest you open a bug report there. This repo here is rustfmt, a tool that auto-formats your code :)
(The error is interesting! I don't really understand what's going on there. If you create a rustc bug report, please link it, I'm curious about the result!)
Rust Information
rustc --version
:rustc 1.55.0-nightly (gentoo)
rustfmt --version
:rustfmt 1.4.37-nightly ( )
cargo --version
:cargo 1.55.0-nightly
rust-analyzer version:
v0.3.794 preview
(nightly mode is enabled)Repro
Issue
When I write my code as suggested, I get a warning for putting parenthesis around this match statement:
However, upon doing what the warning says, I am then greeted with a compiler error (the error persists if I put the parenthesis next to the closing brace of the match statement, as expected)
Misc
Apologies if this is in the wrong repository. Not sure if it should go to clippy, or to rust as this seems like some sort of parser oversight.
The text was updated successfully, but these errors were encountered: