manual_unwrap_or
hint suggest invalid code, due to macro expansion
#6965
Labels
C-bug
Category: Clippy is not doing the correct thing
good-first-issue
These issues are a good way to get started with Clippy
I-suggestion-causes-error
Issue: The suggestions provided by this Lint cause an ICE/error when applied
L-suggestion
Lint: Improving, adding or fixing lint suggestions
It seems that clippy expands the macro before applying some hints resulting in invalid code suggested by the hint
I tried this code:
I expected to see this happen:
Suggestion for
value_t!(matches, "command", f64).unwrap_or(0.0)
Instead, this happened:
The suggestion seems to expand the macro, causing the code to not compile if applying the hint
Meta
cargo clippy -V
: clippy 0.1.52 (673d0db 2021-03-23)rustc -Vv
:The text was updated successfully, but these errors were encountered: