@@ -42,27 +42,27 @@ LL | fn bad_in_fn_syntax(x: fn() -> impl Into<impl Debug>) {}
42
42
|
43
43
= note: `impl Trait` is only allowed in arguments and return types of functions and methods
44
44
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
46
46
--> $DIR/nested_impl_trait.rs:6:46
47
47
|
48
48
LL | 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>`
52
50
|
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
+ | +++++++++++++++++
55
55
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
57
57
--> $DIR/nested_impl_trait.rs:19:34
58
58
|
59
59
LL | 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
63
63
|
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
+ | +++++++++++++++++
66
66
67
67
error: aborting due to 7 previous errors
68
68
0 commit comments