Skip to content

false positive unused-qualifications #114433

Closed
@matthiaskrgr

Description

@matthiaskrgr

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

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsD-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions