2016-09-14 21:51:46 +00:00
|
|
|
struct S;
|
|
|
|
|
|
|
|
trait Tr {
|
|
|
|
fn f() {
|
|
|
|
let s = Self {};
|
2019-07-07 15:34:06 +00:00
|
|
|
//~^ ERROR expected struct, variant or union type, found type parameter
|
2016-09-14 21:51:46 +00:00
|
|
|
let z = Self::<u8> {};
|
2019-07-07 15:34:06 +00:00
|
|
|
//~^ ERROR expected struct, variant or union type, found type parameter
|
2022-06-01 23:55:30 +00:00
|
|
|
//~| ERROR type arguments are not allowed on self type
|
2016-09-14 21:51:46 +00:00
|
|
|
match s {
|
|
|
|
Self { .. } => {}
|
2019-07-07 15:34:06 +00:00
|
|
|
//~^ ERROR expected struct, variant or union type, found type parameter
|
2016-09-14 21:51:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Tr for S {
|
|
|
|
fn f() {
|
|
|
|
let s = Self {}; // OK
|
2022-06-01 23:55:30 +00:00
|
|
|
let z = Self::<u8> {}; //~ ERROR type arguments are not allowed on self type
|
2016-09-14 21:51:46 +00:00
|
|
|
match s {
|
|
|
|
Self { .. } => {} // OK
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl S {
|
|
|
|
fn g() {
|
|
|
|
let s = Self {}; // OK
|
2022-06-01 23:55:30 +00:00
|
|
|
let z = Self::<u8> {}; //~ ERROR type arguments are not allowed on self type
|
2016-09-14 21:51:46 +00:00
|
|
|
match s {
|
|
|
|
Self { .. } => {} // OK
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|