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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
347 B
Rust
Raw Normal View History

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