diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/privacy/private-in-public-lint.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/ui/privacy/private-in-public-lint.rs b/src/test/ui/privacy/private-in-public-lint.rs new file mode 100644 index 000000000..8b6e43601 --- /dev/null +++ b/src/test/ui/privacy/private-in-public-lint.rs @@ -0,0 +1,19 @@ +mod m1 { + pub struct Pub; + struct Priv; + + impl Pub { + pub fn f() -> Priv {Priv} //~ ERROR private type `m1::Priv` in public interface + } +} + +mod m2 { + pub struct Pub; + struct Priv; + + impl Pub { + pub fn f() -> Priv {Priv} //~ ERROR private type `m2::Priv` in public interface + } +} + +fn main() {} |