Skip to content

Suggested improvements to usage-of-qualified-ty lint #63186

Open
@alexreg

Description

@alexreg

Firstly, I don't even know why ty::Ty is a big problem... but I guess it's a readability choice someone made? Moreover, these lints had me stumped for a while.

  • "Qualified" should probably read something like "Namespace-qualified" to be explicit.
  • Ty<> should read Ty.
  • The spans aren't great here. (They should probably just point to the Ty::<'tcx> bits.)
error: usage of qualified `ty::Ty<'tcx>`
   --> src/librustc_mir/interpret/operand.rs:175:18
    |
175 |         let ty = ty::Ty::<'tcx>::decode(self)?;
    |                  ^^^^^^^^^^^^^^^^^^^^^^ help: try using it unqualified: `Ty<'tcx>`
    |
    = note: `-D rustc::usage-of-qualified-ty` implied by `-D rustc::internal`
error: usage of qualified `ty::Ty<>`
   --> src/librustc_mir/interpret/operand.rs:175:18
    |
175 |         let ty = ty::Ty::decode(self)?;
    |                  ^^^^^^^^^^^^^^ help: try using it unqualified: `Ty<>`
    |
    = note: `-D rustc::usage-of-qualified-ty` implied by `-D rustc::internal`

CC @estebank

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.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