-
Notifications
You must be signed in to change notification settings - Fork 13.9k
resolve: Do not consider traits from ambiguous imports to be in scope #147995
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
base: master
Are you sure you want to change the base?
Conversation
|
@bors try |
This comment has been minimized.
This comment has been minimized.
resolve: Do not consider traits from ambiguous imports to be in scope
|
@craterbot check |
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
| impl Trait for u8 {} | ||
| } | ||
|
|
||
| fn test1() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Could you add #[rustfmt::skip] to this and test2, I'd be worried about the test no longer testing the right thing if someone decided to reformat these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense to me, and I agree that it needs a crater run.
|
🎉 Experiment
Footnotes
|
|
All the root regressions (31 of them) are , as expected. I guess we need to somehow preserve these traits in scope, but keep them poisoned, so an error (or a lint) can be reported later during type checking. |
Or a FCW, I think it makes sense to break this someday. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how difficult is the alternative of treating overlapping trait wildcard imports as use module::Trait as _; instead
FCW will also have to be reported in type checking, can't do that without keeping the poisoned traits in scope. |
I'll try to implement both the alternatives and look what's simpler. |
One of unblocking steps for #145108.
Fixes #147992.