error[E0666]: nested `impl Trait` is not allowed --> $DIR/nested_impl_trait.rs:5: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:9: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:13: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:18:44 | LL | fn bad(x: impl Into) -> impl Into { x } | ----------^^^^^^^^^^- | | | | | nested `impl Trait` here | outer `impl Trait` error[E0562]: `impl Trait` not allowed outside of function and method return types --> $DIR/nested_impl_trait.rs:9:32 | LL | fn bad_in_fn_syntax(x: fn() -> impl Into) {} | ^^^^^^^^^^^^^^^^^^^^^ error[E0562]: `impl Trait` not allowed outside of function and method return types --> $DIR/nested_impl_trait.rs:27:42 | LL | fn allowed_in_ret_type() -> impl Fn() -> impl Into { | ^^^^^^^^^^^^^^ error[E0277]: `impl Into` doesn't implement `Debug` --> $DIR/nested_impl_trait.rs:5:70 | LL | fn bad_in_ret_position(x: impl Into) -> impl Into { x } | ^ `impl Into` cannot be formatted using `{:?}` because it doesn't implement `Debug` | help: consider further restricting this bound | LL | fn bad_in_ret_position(x: impl Into + std::fmt::Debug) -> impl Into { x } | +++++++++++++++++ error[E0277]: `impl Into` doesn't implement `Debug` --> $DIR/nested_impl_trait.rs:18:58 | LL | fn bad(x: impl Into) -> impl Into { x } | ^ `impl Into` cannot be formatted using `{:?}` because it doesn't implement `Debug` | help: consider further restricting this bound | LL | fn bad(x: impl Into + std::fmt::Debug) -> impl Into { x } | +++++++++++++++++ error: aborting due to 8 previous errors Some errors have detailed explanations: E0277, E0562, E0666. For more information about an error, try `rustc --explain E0277`.