]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/nested_impl_trait.stderr
Rollup merge of #92917 - jackh726:issue-91762-2, r=nikomatsakis
[rust.git] / src / test / ui / impl-trait / nested_impl_trait.stderr
1 error[E0666]: nested `impl Trait` is not allowed
2   --> $DIR/nested_impl_trait.rs:5:56
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
11   --> $DIR/nested_impl_trait.rs:9:42
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
20   --> $DIR/nested_impl_trait.rs:13:37
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
29   --> $DIR/nested_impl_trait.rs:18:44
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
37 error[E0562]: `impl Trait` not allowed outside of function and method return types
38   --> $DIR/nested_impl_trait.rs:9:32
39    |
40 LL | fn bad_in_fn_syntax(x: fn() -> impl Into<impl Debug>) {}
41    |                                ^^^^^^^^^^^^^^^^^^^^^
42
43 error[E0562]: `impl Trait` not allowed outside of function and method return types
44   --> $DIR/nested_impl_trait.rs:27:42
45    |
46 LL | fn allowed_in_ret_type() -> impl Fn() -> impl Into<u32> {
47    |                                          ^^^^^^^^^^^^^^
48
49 error[E0277]: `impl Into<u32>` doesn't implement `Debug`
50   --> $DIR/nested_impl_trait.rs:5:70
51    |
52 LL | fn bad_in_ret_position(x: impl Into<u32>) -> impl Into<impl Debug> { x }
53    |                                                                      ^ `impl Into<u32>` cannot be formatted using `{:?}` because it doesn't implement `Debug`
54    |
55 help: consider further restricting this bound
56    |
57 LL | fn bad_in_ret_position(x: impl Into<u32> + std::fmt::Debug) -> impl Into<impl Debug> { x }
58    |                                          +++++++++++++++++
59
60 error[E0277]: `impl Into<u32>` doesn't implement `Debug`
61   --> $DIR/nested_impl_trait.rs:18:58
62    |
63 LL |     fn bad(x: impl Into<u32>) -> impl Into<impl Debug> { x }
64    |                                                          ^ `impl Into<u32>` cannot be formatted using `{:?}` because it doesn't implement `Debug`
65    |
66 help: consider further restricting this bound
67    |
68 LL |     fn bad(x: impl Into<u32> + std::fmt::Debug) -> impl Into<impl Debug> { x }
69    |                              +++++++++++++++++
70
71 error: aborting due to 8 previous errors
72
73 Some errors have detailed explanations: E0277, E0562, E0666.
74 For more information about an error, try `rustc --explain E0277`.