-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.
Description
This may be related to #18290 but here is some test code for this specific case:
const LOW_RANGE: char = '0';
const HIGH_RANGE: char = '9';
fn main() {
let x: char = '5';
match x {
LOW_RANGE...HIGH_RANGE => println!("First Match"),
_ => println!("Second Match")
};
}
Which prints:
<anon>:1:1: 1:29 warning: constant item is never used: `LOW_RANGE`, #[warn(dead_code)] on by default
<anon>:1 const LOW_RANGE: char = '0';
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
<anon>:2:1: 2:30 warning: constant item is never used: `HIGH_RANGE`, #[warn(dead_code)] on by default
<anon>:2 const HIGH_RANGE: char = '9';
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
First Match
Ideally this would not issue a warning.
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.