Skip to content

Conversation

@reddevilmidzy
Copy link
Member

@reddevilmidzy reddevilmidzy commented Feb 1, 2026

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 1, 2026
@reddevilmidzy reddevilmidzy marked this pull request as ready for review February 1, 2026 15:52
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 1, 2026
@@ -0,0 +1,8 @@
//! Regression test for <https://github.com/rust-lang/rust/issues/151124>
//@ check-pass
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When building Rustc locally, ICE reproduction was possible for this code without debug-assert

&& old_import != new_import
{
return glob_decl;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a correct change.
Imports are always different here (due to the remove_same_import logic above), so we never update the visibility, but we must indeed update the visibility.

This is a language problem really, this should be an ambiguity error, but we cannot report it without breakage.
And this language problem turns into annoyances in the compiler as well (like #151124).
(#149596 tries to start addressing it in some cases.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the meantime it's better to relax the assert logic in compiler\rustc_middle\src\middle\privacy.rs (preferably only for globs).

Copy link
Contributor

@petrochenkov petrochenkov Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Later this week I'll try to extend the ambiguous_import_visibilities (from #149596) lint to glob-vs-glob ambiguities, this issue may also get fixed in the process.

Copy link
Member Author

@reddevilmidzy reddevilmidzy Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I understand. Thank you for the explanation.
As you said, I modified rustc_middle/src/middle/privacy.rs to avoid asserts.

I'll check back later to see how things are progressing.

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 2, 2026
@reddevilmidzy
Copy link
Member Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ICE: DefId(..)): reachable Public > nominal Restricted(DefId(..)

3 participants