2021-07-22 19:16:33 +01:00
|
|
|
trait Lam {}
|
|
|
|
|
|
|
|
pub struct B;
|
|
|
|
impl Lam for B {}
|
|
|
|
pub struct Wrap<T>(T);
|
|
|
|
|
|
|
|
const _A: impl Lam = {
|
2023-10-04 19:51:43 +00:00
|
|
|
//~^ `impl Trait` only allowed in function and inherent method argument and return types
|
2021-07-22 19:16:33 +01:00
|
|
|
let x: Wrap<impl Lam> = Wrap(B);
|
2023-10-04 19:51:43 +00:00
|
|
|
//~^ `impl Trait` only allowed in function and inherent method argument and return types
|
2021-07-22 19:16:33 +01:00
|
|
|
x.0
|
|
|
|
};
|
|
|
|
|
|
|
|
fn main() {}
|