2023-06-15 15:47:38 +03:00
|
|
|
#![feature(type_privacy_lints)]
|
2023-05-18 14:57:45 +03:00
|
|
|
#![warn(private_bounds)]
|
|
|
|
|
|
|
|
// 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.
|
|
|
|
|
2014-12-07 15:22:06 +00:00
|
|
|
use std::any::Any;
|
2015-01-14 16:08:07 -08:00
|
|
|
use std::any::TypeId;
|
2014-12-07 15:22:06 +00:00
|
|
|
|
2015-08-07 13:23:11 -04:00
|
|
|
trait Private<P, R> {
|
2014-12-07 15:22:06 +00:00
|
|
|
fn call(&self, p: P, r: R);
|
|
|
|
}
|
2016-11-12 12:24:17 +02:00
|
|
|
pub trait Public: Private<
|
|
|
|
//~^ ERROR private trait `Private<<Self as Public>::P, <Self as Public>::R>` in public interface
|
2023-06-29 16:24:07 +03:00
|
|
|
//~| WARNING trait `Private<<Self as Public>::P, <Self as Public>::R>` is more private than the item `Public`
|
2014-12-07 15:22:06 +00:00
|
|
|
<Self as Public>::P,
|
|
|
|
<Self as Public>::R
|
|
|
|
> {
|
|
|
|
type P;
|
|
|
|
type R;
|
|
|
|
|
|
|
|
fn call_inner(&self);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|