-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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_privacy: Fix bugs in SanePrivacyVisitor #29726
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
I'm not actually sure if the part of SanePrivacyVisitor ensuring that there's no |
hir::ItemTrait(..) | hir::ItemDefaultImpl(..) | | ||
hir::ItemConst(..) | hir::ItemStatic(..) | hir::ItemStruct(..) | | ||
hir::ItemFn(..) | hir::ItemMod(..) | hir::ItemTy(..) | | ||
hir::ItemExternCrate(_) | hir::ItemUse(_) => {} |
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.
I personally like to always have exhaustive matches wherever possible, e.g. it's easy to skim over this list and say "ah yeah pub
is allowed on each of these". Perhaps this part could stay?
Looks good to me! (just a minor nit) Scheduling a crater run just to double check |
Crater reports one regression, but I believe it's spurious, so otherwise this should be good to go. |
Updated with exhaustive matching. |
- Check privacy sanity in all blocks, not only function bodies - Check all fields, not only named - Check all impl items, not only methods - Check default impls - Move the sanity check in the beginning of privacy checking, so others could rely on it Technically it's a [breaking-change], but I expect no breakage because, well, it's *sane* privacy visitor, if code is broken it must be insane by definition!
Technically it's a [breaking-change], but I expect no breakage because, well, it's sane privacy visitor, if code is broken it must be insane by definition!