-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Rustc keeps suggesting std::iter::ZipImpl trait who has a "new" method. #45781
Comments
Could you provide more context? A sample of the code and the error message suggesting |
struct T;
fn main() {
T::new();
}
|
Maybe the suggestions should filter out |
oddly enough, |
Currently, we just check that at least one of the type and the trait is local, so indeed, this will false-positive for private traits: rust/src/librustc_typeck/check/method/suggest.rs Lines 445 to 452 in 565907f
|
…etrochenkov On missing method do not suggest private traits When encountering a method call for an ADT that doesn't have any implementation of it, we search for traits that could be implemented that do have that method. Filter out private non-local traits that would not be able to be implemented. This doesn't account for public traits that are in a private scope, but works as a first approximation and is a more correct behavior than the current one. Fix rust-lang#45781.
…etrochenkov On missing method do not suggest private traits When encountering a method call for an ADT that doesn't have any implementation of it, we search for traits that could be implemented that do have that method. Filter out private non-local traits that would not be able to be implemented. This doesn't account for public traits that are in a private scope, but works as a first approximation and is a more correct behavior than the current one. Fix rust-lang#45781.
This is not a real big deal, however rustc keeps suggesting "ZipImpl", which is a implementation detail and rarely is what people want.
Any chance to rename it somehow?
The text was updated successfully, but these errors were encountered: