3 // rust-lang/rust#61631: The use of `Self` in the defaults of generic
4 // types in a *trait* definition are allowed.
6 // It *must* be accepted; we have used this pattern extensively since
7 // Rust 1.0 (see e.g. `trait Add<Rhs=Self>`).
8 trait Tnobound<P = Self> {}
10 impl Tnobound for () { }
12 // This variant is accepted at the definition site; but it will be
13 // rejected at every possible usage site (such as the one immediately
14 // below). Maybe one day we will attempt to catch it at the definition
15 // site, but today this is accepted due to compiler implementation
17 trait Tsized<P: Sized = [Self]> {}
20 //~^ ERROR the size for values of type `[()]` cannot be known at compilation time [E0277]