Incorrect unused_braces when a proc macro is applied to a GAT type conversion #109473
Labels
A-GATs
Area: Generic associated types (GATs)
A-proc-macros
Area: Procedural macros
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
Full example - reproduces locally with serde 1.0.158 and 1.0.156, but not on the playground with serde 1.0.156:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=98ec53a2a8de5c14af46d88f45feda1c
I expected to see this happen:
No warnings, or a warning with a working fix.
Instead, this happened:
An incorrect warning that the braces were not needed around
BAR as u8
.An incorrect suggestion/fix to remove those brances.
Meta
rustc --version --verbose
:The bug also exists in beta and nightly.
The warning itself might be a
serde_derive
bug, but the incorrect fix is a Rust bug:serde-rs/serde#2414
This seems similar to these non-proc macro bugs:
#73068
#88104
The text was updated successfully, but these errors were encountered: