-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
privacy: Relax some asserts on effective visibilities #104546
Conversation
The first invariant is hard to enforce in presence of errors. The second invariant is expensive to enforce fully precisely, so it no longer makes sense given that we were trying to enforce it for performance
r? @lcnr (rustbot has picked a reviewer for you, use r? to override) |
looks sensible. still want someone who knows about this code look at this as there might be a good way to keep these asserts if they're useful r? compiler |
Looks reasonable to me, but I don't think I count as someone who knows this code so I'll reroll too. r? compiler |
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.
r=me with comment addressed or not.
@@ -167,7 +166,7 @@ impl EffectiveVisibilities { | |||
// and all effective visibilities are larger or equal than private visibility. | |||
let private_vis = Visibility::Restricted(tcx.parent_module_from_def_id(def_id)); | |||
let span = tcx.def_span(def_id.to_def_id()); | |||
if !ev.direct.is_at_least(private_vis, tcx) { | |||
if !ev.direct.is_at_least(private_vis, tcx) && tcx.sess.has_errors().is_none() { |
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.
Is it possible to delay span bug here and the assert you removed below?
The first invariant is hard to enforce in presence of errors.
The second invariant is expensive to enforce fully precisely, so it no longer makes sense given that we were trying to enforce it for performance.
Fixes #104249.
Fixes #104539.
(Both ICEs happen only if the compiler is built with debug assertions.)