mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 14:01:51 +00:00
15 lines
347 B
Rust
15 lines
347 B
Rust
#![feature(auto_traits)]
|
|
#![feature(negative_impls)]
|
|
|
|
#[allow(private_interfaces)]
|
|
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
|
|
}
|