rust/src/test/ui/privacy/private-in-public-non-principal-2.rs

15 lines
355 B
Rust
Raw Normal View History

#![feature(optin_builtin_traits)]
#![feature(negative_impls)]
#[allow(private_in_public)]
mod m {
pub trait PubPrincipal {}
auto trait PrivNonPrincipal {}
2019-05-28 13:46:13 -05:00
pub fn leak_dyn_nonprincipal() -> Box<dyn PubPrincipal + PrivNonPrincipal> { loop {} }
}
fn main() {
m::leak_dyn_nonprincipal();
//~^ ERROR trait `PrivNonPrincipal` is private
}