@@ -42,27 +42,27 @@ LL | fn bad_in_fn_syntax(x: fn() -> impl Into<impl Debug>) {}
4242 |
4343 = note: `impl Trait` is only allowed in arguments and return types of functions and methods
4444
45- error[E0277]: the trait bound `impl Debug: From <impl Into<u32> >` is not satisfied
45+ error[E0277]: the trait bound `impl Into<u32>: Into <impl Debug >` is not satisfied
4646 --> $DIR/nested_impl_trait.rs:6:46
4747 |
4848LL | fn bad_in_ret_position(x: impl Into<u32>) -> impl Into<impl Debug> { x }
49- | ^^^^^^^^^^^^^^^^^^^^^ - return type was inferred to be `impl Into<u32>` here
50- | |
51- | the trait `From<impl Into<u32>>` is not implemented for `impl Debug`
49+ | ^^^^^^^^^^^^^^^^^^^^^ the trait `Debug` is not implemented for `impl Into<u32>`
5250 |
53- = help: the trait `Into<U>` is implemented for `T`
54- = note: required for `impl Into<u32>` to implement `Into<impl Debug>`
51+ help: consider further restricting this bound
52+ |
53+ LL | fn bad_in_ret_position(x: impl Into<u32> + std::fmt::Debug) -> impl Into<impl Debug> { x }
54+ | +++++++++++++++++
5555
56- error[E0277]: the trait bound `impl Debug: From <impl Into<u32> >` is not satisfied
56+ error[E0277]: the trait bound `impl Into<u32>: Into <impl Debug >` is not satisfied
5757 --> $DIR/nested_impl_trait.rs:19:34
5858 |
5959LL | fn bad(x: impl Into<u32>) -> impl Into<impl Debug> { x }
60- | ^^^^^^^^^^^^^^^^^^^^^ - return type was inferred to be `impl Into<u32>` here
61- | |
62- | the trait `From<impl Into<u32>>` is not implemented for `impl Debug`
60+ | ^^^^^^^^^^^^^^^^^^^^^ the trait `Debug` is not implemented for `impl Into<u32>`
61+ |
62+ help: consider further restricting this bound
6363 |
64- = help: the trait ` Into<U>` is implemented for `T`
65- = note: required for `impl Into<u32>` to implement `Into<impl Debug>`
64+ LL | fn bad(x: impl Into<u32> + std::fmt::Debug) -> impl Into<impl Debug> { x }
65+ | +++++++++++++++++
6666
6767error: aborting due to 7 previous errors
6868
0 commit comments