diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/privacy/private-in-public-non-principal.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/ui/privacy/private-in-public-non-principal.rs b/src/test/ui/privacy/private-in-public-non-principal.rs new file mode 100644 index 000000000..ac1d5a9e6 --- /dev/null +++ b/src/test/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() {} |