]>
Commit | Line | Data |
---|---|---|
0531ce1d | 1 | error[E0666]: nested `impl Trait` is not allowed |
0731742a | 2 | --> $DIR/nested_impl_trait.rs:5:56 |
0531ce1d XL |
3 | | |
4 | LL | fn bad_in_ret_position(x: impl Into<u32>) -> impl Into<impl Debug> { x } | |
5 | | ----------^^^^^^^^^^- | |
6 | | | | | |
7 | | | nested `impl Trait` here | |
8 | | outer `impl Trait` | |
9 | ||
10 | error[E0666]: nested `impl Trait` is not allowed | |
5e7ed085 | 11 | --> $DIR/nested_impl_trait.rs:9:42 |
0531ce1d XL |
12 | | |
13 | LL | fn bad_in_fn_syntax(x: fn() -> impl Into<impl Debug>) {} | |
14 | | ----------^^^^^^^^^^- | |
15 | | | | | |
16 | | | nested `impl Trait` here | |
17 | | outer `impl Trait` | |
18 | ||
19 | error[E0666]: nested `impl Trait` is not allowed | |
5e7ed085 | 20 | --> $DIR/nested_impl_trait.rs:13:37 |
0531ce1d XL |
21 | | |
22 | LL | fn bad_in_arg_position(_: impl Into<impl Debug>) { } | |
23 | | ----------^^^^^^^^^^- | |
24 | | | | | |
25 | | | nested `impl Trait` here | |
26 | | outer `impl Trait` | |
27 | ||
28 | error[E0666]: nested `impl Trait` is not allowed | |
5e7ed085 | 29 | --> $DIR/nested_impl_trait.rs:18:44 |
0531ce1d XL |
30 | | |
31 | LL | fn bad(x: impl Into<u32>) -> impl Into<impl Debug> { x } | |
32 | | ----------^^^^^^^^^^- | |
33 | | | | | |
34 | | | nested `impl Trait` here | |
35 | | outer `impl Trait` | |
36 | ||
5099ac24 | 37 | error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `fn` pointer return |
5e7ed085 | 38 | --> $DIR/nested_impl_trait.rs:9:32 |
0531ce1d XL |
39 | | |
40 | LL | fn bad_in_fn_syntax(x: fn() -> impl Into<impl Debug>) {} | |
41 | | ^^^^^^^^^^^^^^^^^^^^^ | |
42 | ||
5099ac24 | 43 | error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in `Fn` trait return |
5e7ed085 | 44 | --> $DIR/nested_impl_trait.rs:27:42 |
0531ce1d XL |
45 | | |
46 | LL | fn allowed_in_ret_type() -> impl Fn() -> impl Into<u32> { | |
47 | | ^^^^^^^^^^^^^^ | |
48 | ||
5e7ed085 FG |
49 | error[E0277]: the trait bound `impl Debug: From<impl Into<u32>>` is not satisfied |
50 | --> $DIR/nested_impl_trait.rs:5:46 | |
51 | | | |
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` | |
54 | | | |
04454e1e | 55 | = help: the trait `Into<U>` is implemented for `T` |
5e7ed085 FG |
56 | = note: required because of the requirements on the impl of `Into<impl Debug>` for `impl Into<u32>` |
57 | ||
58 | error[E0277]: the trait bound `impl Debug: From<impl Into<u32>>` is not satisfied | |
59 | --> $DIR/nested_impl_trait.rs:18:34 | |
60 | | | |
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` | |
63 | | | |
04454e1e | 64 | = help: the trait `Into<U>` is implemented for `T` |
5e7ed085 FG |
65 | = note: required because of the requirements on the impl of `Into<impl Debug>` for `impl Into<u32>` |
66 | ||
67 | error: aborting due to 8 previous errors | |
0531ce1d | 68 | |
5e7ed085 FG |
69 | Some errors have detailed explanations: E0277, E0562, E0666. |
70 | For more information about an error, try `rustc --explain E0277`. |