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 when trait contains method with same name as method from trait heirachy #3117

Open
Havvy opened this issue Sep 3, 2018 · 0 comments
Open
Labels
A-lint Area: New lints

Comments

@Havvy
Copy link

Havvy commented Sep 3, 2018

If a trait declares a method that has the same name as a method from its trait hierarchy, then both methods can only be called via UFCS. It's also confusing. As such, clippy should lint against it.

trait Base {
     fn method() {}
}

trait Subtrait : Base {
    //~ warning: method has same name as Base::method.
    fn method() {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints
Projects
None yet
Development

No branches or pull requests

2 participants