Ah, so you have a trait, and wish that only some methods were public?
-
-
Replying to @seanmonstar @rustlang
Basically. I think Niko just suggested a workaround that might work:
1 reply 0 retweets 0 likes -
8:43 AM <nmatsakis> `pub(crate) mod internal { use super::*; pub trait Foo { .. } }` really
2 replies 0 retweets 0 likes -
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
Yep, many of us do! There's been a lot of discussion about the nuances of private-in-public ;_;
-
-
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 -
I can certainly be convinced I'm wrong, but that's my intuition too.
0 replies 0 retweets 0 likes
End of conversation
New conversation -
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.