Skip to content
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

false positive unused-qualifications #114433

Closed
matthiaskrgr opened this issue Aug 3, 2023 · 0 comments · Fixed by #114503
Closed

false positive unused-qualifications #114433

matthiaskrgr opened this issue Aug 3, 2023 · 0 comments · Fixed by #114503
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints D-invalid-suggestion Diagnostics: A structured suggestion resulting in incorrect code. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

Code

#![warn(unused_qualifications)]

fn bar3() {
    match Option::<Option<()>>::None {

/*
help: remove the unnecessary path segments
  |
4 -     match Option::<Option<()>>::None {
4 +     match None {
  |
*/
        Some(v) => {}
        None => {}
    }
}

fn main() {}

Current output

warning: unnecessary qualification
 --> q.rs:4:11
  |
4 |     match Option::<Option<()>>::None {
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
note: the lint level is defined here
 --> q.rs:1:9
  |
1 | #![warn(unused_qualifications)]
  |         ^^^^^^^^^^^^^^^^^^^^^
help: remove the unnecessary path segments
  |
4 -     match Option::<Option<()>>::None {
4 +     match None {
  |

Desired output

No response

Rationale and extra context

maybe don't lint? the suggested None breaks type inference

Other cases

No response

Anything else?

No response

@matthiaskrgr matthiaskrgr added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. D-invalid-suggestion Diagnostics: A structured suggestion resulting in incorrect code. labels Aug 3, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 3, 2023
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 4, 2023
@chenyukang chenyukang self-assigned this Aug 4, 2023
@bors bors closed this as completed in 83d84ff Aug 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints D-invalid-suggestion Diagnostics: A structured suggestion resulting in incorrect code. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants