1 // Test that impl trait does not allow creating recursive types that are
2 // otherwise forbidden. Even when there's an opaque type in another crate
5 fn id<T>(t: T) -> impl Sized { t }
7 fn recursive_id() -> impl Sized { //~ ERROR cannot resolve opaque type
11 fn recursive_id2() -> impl Sized { //~ ERROR cannot resolve opaque type
15 fn wrap<T>(t: T) -> impl Sized { (t,) }
17 fn recursive_wrap() -> impl Sized { //~ ERROR cannot resolve opaque type
18 wrap(recursive_wrap2())
21 fn recursive_wrap2() -> impl Sized { //~ ERROR cannot resolve opaque type
22 wrap(recursive_wrap())