You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
% rustc /tmp/p.rsb_
/tmp/p.rs:7:25: 7:28 warning: private type in exported type signature, #[warn(visible_private_types)] on by default
/tmp/p.rs:7 pub fn foo() -> Bar { Bar }
^~~
Now, maybe in the above code the problem is obvious, but in the original context where this arose, the inner was in a separate file from hello, and I did a lot of head scratching, saying "but I saidpub struct Bar..."
I think that if the lint is complaining about a type that is itself declared public, then the lint should have a note indicating at least one module along the chain that is private. And maybe a note saying "you can fix this by either doing pub use self::inner::Bar or by making the mod inner public."
The text was updated successfully, but these errors were encountered:
Here is some code:
when I try to compile it, I get:
Now, maybe in the above code the problem is obvious, but in the original context where this arose, the
inner
was in a separate file fromhello
, and I did a lot of head scratching, saying "but I saidpub struct Bar
..."I think that if the lint is complaining about a type that is itself declared public, then the lint should have a note indicating at least one module along the chain that is private. And maybe a note saying "you can fix this by either doing
pub use self::inner::Bar
or by making themod inner
public."The text was updated successfully, but these errors were encountered: