2017-02-02 06:18:13 -06:00
|
|
|
#![feature(associated_type_defaults)]
|
|
|
|
|
2017-01-08 05:06:44 -06:00
|
|
|
struct S<T = u8>(T);
|
2017-02-02 06:18:13 -06:00
|
|
|
trait Tr<T = u8> {
|
|
|
|
type A = ();
|
|
|
|
}
|
2017-01-08 05:06:44 -06:00
|
|
|
|
|
|
|
impl Tr<Self> for S {} // OK
|
2017-02-02 06:18:13 -06: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 05:06:44 -06:00
|
|
|
|
2022-10-27 16:18:26 -05: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 16:21:00 -05:00
|
|
|
impl Tr<Self::A> for S {} //~ ERROR cycle detected
|
2017-01-08 05:06:44 -06:00
|
|
|
|
|
|
|
fn main() {}
|