-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ICE when use-ing enum variant after glob-importing same-named enum #62767
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Compiler team check-in: I'm marking this as P-medium for now as it is not classified as a regression, although it seems like a fairly major problem. @petrochenkov appears to be on it, though. |
Feel free to add the I-nominated label if you think it should be P-high |
The assertion was added late last year. @petrochenkov could you take a look at this to see if it is valid for the invariant being checked not to hold in this case? If I comment out the
|
I'll see what happens (that's why I self-assigned). |
...which was exactly the case here! Fixed in #70236. |
…-morse resolve: Avoid "self-confirming" import resolutions in one more case So the idea behind "blacklisted bindings" is that we must ignore some name definitions during resolution because otherwise they cause infinite cycles. E.g. import ```rust use my_crate; ``` would refer to itself (on 2018 edition) without this blacklisting, because `use my_crate;` is the first name in scope when we are resolving `my_crate` here. In this PR we are doing this blacklisting for the case ```rust use same::same; ``` , namely blacklisting the second `same` when resolving the first `same`. This was previously forgotten. Fixes rust-lang#62767
playpen
Reproduction code:
If I re-export
pub use Foo::*
in the module, it works as expected, having enumFoo
in the type-namespace and variantFoo
in the value-namespace (playpen).The text was updated successfully, but these errors were encountered: