Skip to content

unused_qualification removes generic params #113808

Closed
@matthiaskrgr

Description

@matthiaskrgr

I tried this code:

// run-pass

#![feature(unsized_fn_params)]

use std::ops;
use std::ops::Index;

pub struct A;

impl ops::Index<str> for A {
    type Output = ();
    fn index(&self, _: str) -> &Self::Output {
        &()
    }
}

rustc --force-warn unused-qualifications

warning: unnecessary qualification
  --> ./tests/ui/unsized-locals/unsized-index.rs:10:6
   |
10 | impl ops::Index<str> for A {
   |      ^^^^^^^^^^^^^^^
   |
   = note: requested on the command line with `--force-warn unused-qualifications`
help: replace it with the unqualified path
   |
10 | impl Index for A {
   |      ~~~~~

Somehow the generic info gets lost completely? :S

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`C-bugCategory: This is a bug.D-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.D-papercutDiagnostics: An error or lint that needs small tweaks.L-unused_qualificationsLint: unused_qualificationsT-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