2023-06-15 15:47:38 +03:00
|
|
|
#![feature(type_privacy_lints)]
|
2023-05-18 14:57:45 +03:00
|
|
|
#[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.
|
|
|
|
|
2016-08-19 16:44:47 +02:00
|
|
|
trait Foo {
|
|
|
|
fn dummy(&self) { }
|
|
|
|
}
|
|
|
|
|
2016-08-24 17:43:51 +05:30
|
|
|
pub trait Bar : Foo {}
|
2016-11-12 12:24:17 +02:00
|
|
|
//~^ ERROR private trait `Foo` in public interface [E0445]
|
2023-06-29 16:24:07 +03:00
|
|
|
//~| WARNING trait `Foo` is more private than the item `Bar`
|
2016-08-24 17:43:51 +05:30
|
|
|
pub struct Bar2<T: Foo>(pub T);
|
2016-11-12 12:24:17 +02:00
|
|
|
//~^ ERROR private trait `Foo` in public interface [E0445]
|
2023-06-29 16:24:07 +03:00
|
|
|
//~| WARNING trait `Foo` is more private than the item `Bar2`
|
2016-08-24 17:43:51 +05:30
|
|
|
pub fn foo<T: Foo> (t: T) {}
|
2016-11-12 12:24:17 +02:00
|
|
|
//~^ ERROR private trait `Foo` in public interface [E0445]
|
2023-06-29 16:24:07 +03:00
|
|
|
//~| WARNING trait `Foo` is more private than the item `foo`
|
2016-08-19 16:44:47 +02:00
|
|
|
|
|
|
|
fn main() {}
|