2017-02-02 12:18:13 +00:00
|
|
|
#![feature(associated_type_defaults)]
|
|
|
|
|
2017-01-08 11:06:44 +00:00
|
|
|
struct S<T = u8>(T);
|
2017-02-02 12:18:13 +00:00
|
|
|
trait Tr<T = u8> {
|
|
|
|
type A = ();
|
|
|
|
}
|
2017-01-08 11:06:44 +00:00
|
|
|
|
|
|
|
impl Tr<Self> for S {} // OK
|
2017-02-02 12:18:13 +00:00
|
|
|
impl<T: Tr<Self>> Tr<T> for S {} // OK
|
|
|
|
impl Tr for S where Self: Copy {} // OK
|
|
|
|
impl Tr for S where S<Self>: Copy {} // OK
|
|
|
|
impl Tr for S where Self::A: Copy {} // OK
|
2017-01-08 11:06:44 +00:00
|
|
|
|
2022-10-27 21:18:26 +00:00
|
|
|
impl Tr for Self {} //~ ERROR `Self` is not valid in the self type of an impl block
|
|
|
|
impl Tr for S<Self> {} //~ ERROR `Self` is not valid in the self type of an impl block
|
|
|
|
impl Self {} //~ ERROR `Self` is not valid in the self type of an impl block
|
|
|
|
impl S<Self> {} //~ ERROR `Self` is not valid in the self type of an impl block
|
|
|
|
impl (Self, Self) {} //~ ERROR `Self` is not valid in the self type of an impl block
|
2018-04-15 21:21:00 +00:00
|
|
|
impl Tr<Self::A> for S {} //~ ERROR cycle detected
|
2017-01-08 11:06:44 +00:00
|
|
|
|
|
|
|
fn main() {}
|