Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
petrochenkov opened this issue Oct 13, 2019 · 1 comment · Fixed by #82868
Closed

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

petrochenkov opened this issue Oct 13, 2019 · 1 comment · Fixed by #82868
Labels
A-edition-2018-lints Area: Lints supporting the 2018 edition A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@petrochenkov
Copy link
Contributor

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.

@jonas-schievink jonas-schievink added A-edition-2018-lints Area: Lints supporting the 2018 edition A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 13, 2019
@petrochenkov
Copy link
Contributor Author

Fixed in #82868.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-edition-2018-lints Area: Lints supporting the 2018 edition A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants