mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
20 lines
548 B
Rust
20 lines
548 B
Rust
#[warn(private_bounds)]
|
|
#[warn(private_interfaces)]
|
|
|
|
// In this test both old and new private-in-public diagnostic were emitted.
|
|
// Old diagnostic will be deleted soon.
|
|
// See https://rust-lang.github.io/rfcs/2145-type-privacy.html.
|
|
|
|
trait Foo {
|
|
fn dummy(&self) { }
|
|
}
|
|
|
|
pub trait Bar : Foo {}
|
|
//~^ ERROR private trait `Foo` in public interface [E0445]
|
|
pub struct Bar2<T: Foo>(pub T);
|
|
//~^ ERROR private trait `Foo` in public interface [E0445]
|
|
pub fn foo<T: Foo> (t: T) {}
|
|
//~^ ERROR private trait `Foo` in public interface [E0445]
|
|
|
|
fn main() {}
|