Skip to content

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

Closed

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.

Activity

  1. added
    A-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.
    on Oct 13, 2019
  2. petrochenkov commented on Mar 7, 2021

    @petrochenkov
    ContributorAuthor

    Fixed in #82868.

  3. added a commit that references this issue on Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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