Skip to content

Lint bare_trait_objects doesn't warn on traits used as types in paths #65371

Closed
@petrochenkov

Description

@petrochenkov

Example:

trait Method { fn method() {} }

trait Tr {}

impl Method for Tr {} // warning: trait objects without an explicit `dyn` are deprecated

fn main() {
    Tr::method; // No warning
}

According to the logic of the lint there should be a suggestion to rewrite Tr::method as <dyn Tr>::method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-edition-2018Area: The 2018 editionA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.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