error[E0666]: nested `impl Trait` is not allowed --> $DIR/nested_impl_trait.rs:6:56 | LL | fn bad_in_ret_position(x: impl Into) -> impl Into { x } | ----------^^^^^^^^^^- | | | | | nested `impl Trait` here | outer `impl Trait` error[E0666]: nested `impl Trait` is not allowed --> $DIR/nested_impl_trait.rs:10:42 | LL | fn bad_in_fn_syntax(x: fn() -> impl Into) {} | ----------^^^^^^^^^^- | | | | | nested `impl Trait` here | outer `impl Trait` error[E0666]: nested `impl Trait` is not allowed --> $DIR/nested_impl_trait.rs:14:37 | LL | fn bad_in_arg_position(_: impl Into) { } | ----------^^^^^^^^^^- | | | | | nested `impl Trait` here | outer `impl Trait` error[E0666]: nested `impl Trait` is not allowed --> $DIR/nested_impl_trait.rs:19:44 | LL | fn bad(x: impl Into) -> impl Into { x } | ----------^^^^^^^^^^- | | | | | nested `impl Trait` here | outer `impl Trait` error[E0562]: `impl Trait` is not allowed in `fn` pointer return types --> $DIR/nested_impl_trait.rs:10:32 | LL | fn bad_in_fn_syntax(x: fn() -> impl Into) {} | ^^^^^^^^^^^^^^^^^^^^^ | = note: `impl Trait` is only allowed in arguments and return types of functions and methods error[E0277]: the trait bound `impl Debug: From>` is not satisfied --> $DIR/nested_impl_trait.rs:6:46 | LL | fn bad_in_ret_position(x: impl Into) -> impl Into { x } | ^^^^^^^^^^^^^^^^^^^^^ the trait `From>` is not implemented for `impl Debug`, which is required by `impl Into: Into` | = help: the trait `Into` is implemented for `T` = note: required for `impl Into` to implement `Into` error[E0277]: the trait bound `impl Debug: From>` is not satisfied --> $DIR/nested_impl_trait.rs:19:34 | LL | fn bad(x: impl Into) -> impl Into { x } | ^^^^^^^^^^^^^^^^^^^^^ the trait `From>` is not implemented for `impl Debug`, which is required by `impl Into: Into` | = help: the trait `Into` is implemented for `T` = note: required for `impl Into` to implement `Into` error: aborting due to 7 previous errors Some errors have detailed explanations: E0277, E0562, E0666. For more information about an error, try `rustc --explain E0277`.