rust/tests/ui/privacy/private-in-public-non-principal-2.rs
2023-01-11 09:32:08 +00:00

15 lines
346 B
Rust

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