Skip to content

Dead code check false positive for static used in match #10865

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jfager opened this issue Dec 9, 2013 · 2 comments · Fixed by #10870
Closed

Dead code check false positive for static used in match #10865

jfager opened this issue Dec 9, 2013 · 2 comments · Fixed by #10870
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut.

Comments

@jfager
Copy link
Contributor

jfager commented Dec 9, 2013

With #10477 landed, the following snippet complains that FOO is unused:

static FOO: u16 = 1;

fn main() {
    let i = 1;
    match i {
        FOO => println!("matched"),
        _ => println!("unmatched")
    }
}
@huonw
Copy link
Member

huonw commented Dec 9, 2013

cc @ktt3ja

@ktt3ja
Copy link
Contributor

ktt3ja commented Dec 9, 2013

Thanks.

@bors bors closed this as completed in 3d3a663 Dec 14, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 30, 2023
…ing, r=Jarcho

[`let_with_type_underscore`]: Don't emit on locals from procedural macros

closes rust-lang#10498

changelog: [`let_with_type_underscore`]: Don't emit on locals from procedural macros
flip1995 pushed a commit to flip1995/rust that referenced this issue Jul 6, 2023
…ing, r=Jarcho

[`let_with_type_underscore`]: Don't emit on locals from procedural macros

closes rust-lang#10498

changelog: [`let_with_type_underscore`]: Don't emit on locals from procedural macros
MabezDev pushed a commit to esp-rs/rust that referenced this issue Jul 13, 2023
…ing, r=Jarcho

[`let_with_type_underscore`]: Don't emit on locals from procedural macros

closes rust-lang#10498

changelog: [`let_with_type_underscore`]: Don't emit on locals from procedural macros
xobs pushed a commit to betrusted-io/rust that referenced this issue Aug 5, 2023
…ing, r=Jarcho

[`let_with_type_underscore`]: Don't emit on locals from procedural macros

closes rust-lang#10498

changelog: [`let_with_type_underscore`]: Don't emit on locals from procedural macros
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants