blob: db451d33429b31fce2832de62b3aa2d90b7ca59b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
#![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
}
|