]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/issues/issue-58956.rs
Merge commit '266e96785ab71834b917bf474f130a6d8fdecd4b' into sync_cg_clif-2022-10-23
[rust.git] / src / test / ui / impl-trait / issues / issue-58956.rs
1 trait Lam {}
2
3 pub struct B;
4 impl Lam for B {}
5 pub struct Wrap<T>(T);
6
7 const _A: impl Lam = {
8     //~^ `impl Trait` only allowed in function and inherent method return types
9     let x: Wrap<impl Lam> = Wrap(B);
10     //~^ `impl Trait` only allowed in function and inherent method return types
11     x.0
12 };
13
14 fn main() {}