summaryrefslogtreecommitdiffstats
path: root/tests/ui/privacy/private-in-public-non-principal.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/privacy/private-in-public-non-principal.rs')
-rw-r--r--tests/ui/privacy/private-in-public-non-principal.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/privacy/private-in-public-non-principal.rs b/tests/ui/privacy/private-in-public-non-principal.rs
new file mode 100644
index 000000000..ac1d5a9e6
--- /dev/null
+++ b/tests/ui/privacy/private-in-public-non-principal.rs
@@ -0,0 +1,21 @@
+#![feature(auto_traits)]
+#![feature(negative_impls)]
+
+pub trait PubPrincipal {}
+auto trait PrivNonPrincipal {}
+
+pub fn leak_dyn_nonprincipal() -> Box<dyn PubPrincipal + PrivNonPrincipal> { loop {} }
+//~^ WARN private trait `PrivNonPrincipal` in public interface
+//~| WARN this was previously accepted
+
+#[deny(missing_docs)]
+fn container() {
+ impl dyn PubPrincipal {
+ pub fn check_doc_lint() {} //~ ERROR missing documentation for an associated function
+ }
+ impl dyn PubPrincipal + PrivNonPrincipal {
+ pub fn check_doc_lint() {} // OK, no missing doc lint
+ }
+}
+
+fn main() {}