Uh oh!
There was an error while loading. Please reload this page.
Stabilize pub(restricted) - #40556
Conversation
rust-highfive
commented
Mar 15, 2017
(rust_highfive has picked a reviewer for you, use r? to override) |
retep998
commented
Mar 15, 2017
Shouldn't we first just stabilize |
cramertj
commented
Mar 15, 2017
@retep998 That seems reasonable to me. |
862e42b to
376739fComparecramertj
commented
Mar 15, 2017
@retep998 I'll have a new commit up in a minute with that change. |
There was a problem hiding this comment.
private_in_public can't be turned into an error in the near future unfortunately.self.tcx.sess.features.borrow().pub_restricted can be well approximated with is_pub_restricted(vis) && is_pub_restricted(self.required_visibility) where is_pub_restricted = not pub && not private.
The idea is to always report an error and not warning when pub(something) is involved.
There was a problem hiding this comment.
What do you mean by not private? Visibility is either Public, Restricted(DefId), or Invisible (reserved for private external items).
There was a problem hiding this comment.
You can use hir::Visibility for this (as opposed to ty::Visibility).
For vis HIR visibility is immediately available (item.vis) , for self.required_visibility you can pass it from PrivateItemsInPublicInterfacesVisitor::visit_item to here somehow.
There was a problem hiding this comment.
Even for hir::Visibility, I still only see Public, Crate, Restricted {...}, and Inherited, no Private. Am I missing something obvious?
There was a problem hiding this comment.
Inherited is private (i.e. no any explicit pub)
376739f to
7447348Comparesfackler
commented
Mar 16, 2017
Beta nominating since I think @aturon was interested in landing this in 1.17. |
7447348 to
28626caCompareI'm not inclined to backport a stabilization -- or at least not this one. |
nikomatsakis
commented
Mar 16, 2017
@bors r+ |
bors
commented
Mar 16, 2017
📌 Commit 28626ca has been approved by |
nikomatsakis
commented
Mar 16, 2017
Note: doc pr is here: rust-lang/reference#12 |
petrochenkov
commented
Mar 16, 2017
Right now this PR turns all private-in-public errors for @bors r- |
nikomatsakis
commented
Mar 16, 2017
Hmm. I see. OK, that probably makes sense. |
I disagree with this stabilization. This is a poor implementation of |
nikomatsakis
commented
Mar 16, 2017
Removing beta-nominated. Seems like there is no need to backport a stabilization, no great urgency. |
strega-nil
commented
Mar 17, 2017
Okay, I remove my disagreement, actually (sorry). I read more of the reasoning behind the need for |
petrochenkov
commented
Mar 17, 2017
@cramertj |
@petrochenkov I was just finishing up piping Just to make sure I understood you: the process is to add a new visitor which runs in |
petrochenkov
commented
Mar 17, 2017
Exactly. |
nikomatsakis
commented
Mar 20, 2017
r? @petrochenkov -- since you have something specific in mind =) |
petrochenkov
commented
Mar 20, 2017
@bors r+ |
bors
commented
Mar 20, 2017
📌 Commit 60c1c96 has been approved by |
…r=petrochenkov Stabilize pub(restricted) Fixrust-lang#32409
bors
commented
Mar 21, 2017
support pub(restricted) in thread_local! (round 2) Resurrected #40984 now that the issue blocking it was fixed. Original description: `pub(restricted)` was stabilized in #40556 so let's go! Here is a [playground](https://play.rust-lang.org/?gist=f55f32f164a6ed18c219fec8f8293b98&version=nightly&backtrace=1). I changed the interface of `__thread_local_inner!`, which is supposedly unstable but this is not checked for macros (#34097 cc @petrochenkov@jseyfried), so this may be an issue.
Fix#32409