1 error[E0666]: nested `impl Trait` is not allowed
2 --> $DIR/nested_impl_trait.rs:5:56
4 LL | fn bad_in_ret_position(x: impl Into<u32>) -> impl Into<impl Debug> { x }
5 | ----------^^^^^^^^^^-
7 | | nested `impl Trait` here
10 error[E0666]: nested `impl Trait` is not allowed
11 --> $DIR/nested_impl_trait.rs:9:42
13 LL | fn bad_in_fn_syntax(x: fn() -> impl Into<impl Debug>) {}
14 | ----------^^^^^^^^^^-
16 | | nested `impl Trait` here
19 error[E0666]: nested `impl Trait` is not allowed
20 --> $DIR/nested_impl_trait.rs:13:37
22 LL | fn bad_in_arg_position(_: impl Into<impl Debug>) { }
23 | ----------^^^^^^^^^^-
25 | | nested `impl Trait` here
28 error[E0666]: nested `impl Trait` is not allowed
29 --> $DIR/nested_impl_trait.rs:18:44
31 LL | fn bad(x: impl Into<u32>) -> impl Into<impl Debug> { x }
32 | ----------^^^^^^^^^^-
34 | | nested `impl Trait` here
37 error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `fn` pointer return
38 --> $DIR/nested_impl_trait.rs:9:32
40 LL | fn bad_in_fn_syntax(x: fn() -> impl Into<impl Debug>) {}
41 | ^^^^^^^^^^^^^^^^^^^^^
43 error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait return
44 --> $DIR/nested_impl_trait.rs:27:42
46 LL | fn allowed_in_ret_type() -> impl Fn() -> impl Into<u32> {
49 error[E0277]: the trait bound `impl Debug: From<impl Into<u32>>` is not satisfied
50 --> $DIR/nested_impl_trait.rs:5:46
52 LL | fn bad_in_ret_position(x: impl Into<u32>) -> impl Into<impl Debug> { x }
53 | ^^^^^^^^^^^^^^^^^^^^^ the trait `From<impl Into<u32>>` is not implemented for `impl Debug`
55 = help: the trait `Into<U>` is implemented for `T`
56 = note: required for `impl Into<u32>` to implement `Into<impl Debug>`
58 error[E0277]: the trait bound `impl Debug: From<impl Into<u32>>` is not satisfied
59 --> $DIR/nested_impl_trait.rs:18:34
61 LL | fn bad(x: impl Into<u32>) -> impl Into<impl Debug> { x }
62 | ^^^^^^^^^^^^^^^^^^^^^ the trait `From<impl Into<u32>>` is not implemented for `impl Debug`
64 = help: the trait `Into<U>` is implemented for `T`
65 = note: required for `impl Into<u32>` to implement `Into<impl Debug>`
67 error: aborting due to 8 previous errors
69 Some errors have detailed explanations: E0277, E0562, E0666.
70 For more information about an error, try `rustc --explain E0277`.