- Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-suggestion-causes-errorIssue: The suggestions provided by this Lint cause an ICE/error when appliedIssue: The suggestions provided by this Lint cause an ICE/error when appliedL-suggestionLint: Improving, adding or fixing lint suggestionsLint: Improving, adding or fixing lint suggestions

Description
cargo clippy -V
: clippy 0.0.212 (69f99e7 2019-12-14)
Playground link: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=401f208640cdf49300acf4ef902f01ee
Minimal example:
#![warn(clippy::replace_consts)] fn main() { match 0_u32 { 0 => "zero", // std::u32::MAX is suggested to be replaced with u32::max_value() 1..=std::u32::MAX => "more", }; }
If I try replacing std::u32::MAX
with u32::max_value()
, I get a syntax error from rust. Wrapping in parenthesis or curly braces doesn't make it valid.
I don't get a warning if it's not part of a range.
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-suggestion-causes-errorIssue: The suggestions provided by this Lint cause an ICE/error when appliedIssue: The suggestions provided by this Lint cause an ICE/error when appliedL-suggestionLint: Improving, adding or fixing lint suggestionsLint: Improving, adding or fixing lint suggestions