8:43 AM <nmatsakis> `pub(crate) mod internal { use super::*; pub trait Foo { .. } }` really
-
-
IOW put the internal modules inside and make the *modules* pub(crate) and the *traits* pub
1 reply 0 retweets 0 likes -
The question is whether rustc will catch me doing an end run around it and stab me in the eye
1 reply 0 retweets 0 likes -
Replying to @littlecalculist @rustlang
Nope, that escape hatch is on purpose O_o
1 reply 0 retweets 0 likes -
Replying to @seanmonstar @rustlang
Ah ok! What I missed was that I could make the nested module pub(crate).
2 replies 0 retweets 0 likes -
It's weird if that's allowed but not a pub trait inheriting directly from a pub(crate) trait. What does that actually protect?
1 reply 0 retweets 0 likes -
Replying to @littlecalculist @rustlang
The privacy checker looks at the direct visibility of the item, not if it is visible from outside the crate.
1 reply 0 retweets 0 likes -
Replying to @seanmonstar @rustlang
Yeah I just think that's a suboptimal design. But no matter, I think this will be way way better. Thank you so much!
2 replies 0 retweets 0 likes -
Replying to @littlecalculist @rustlang
Yep, many of us do! There's been a lot of discussion about the nuances of private-in-public ;_;
1 reply 0 retweets 1 like -
I think the private-in-public lint is broken. It looks only at 'pub' annotations, it should analyze reachability (incl. through 'pub use')
3 replies 0 retweets 2 likes
That was proposed, and purposefully decided against, at least at that time.
-
-
“It’s not a bug, it’s a feature.”
0 replies 0 retweets 1 likeThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.