]> git.lizzy.rs Git - rust.git/blob - tests/ui/impl-trait/nested_impl_trait.stderr
Auto merge of #106171 - compiler-errors:consolidate-extract_callable_info, r=estebank...
[rust.git] / tests / ui / impl-trait / nested_impl_trait.stderr
1 error[E0666]: nested `impl Trait` is not allowed
2   --> $DIR/nested_impl_trait.rs:6: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:10: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:14: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:19: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` only allowed in function and inherent method return types, not in `fn` pointer return
38   --> $DIR/nested_impl_trait.rs:10:32
39    |
40 LL | fn bad_in_fn_syntax(x: fn() -> impl Into<impl Debug>) {}
41    |                                ^^^^^^^^^^^^^^^^^^^^^
42
43 error[E0277]: the trait bound `impl Debug: From<impl Into<u32>>` is not satisfied
44   --> $DIR/nested_impl_trait.rs:6:46
45    |
46 LL | fn bad_in_ret_position(x: impl Into<u32>) -> impl Into<impl Debug> { x }
47    |                                              ^^^^^^^^^^^^^^^^^^^^^ the trait `From<impl Into<u32>>` is not implemented for `impl Debug`
48    |
49    = help: the trait `Into<U>` is implemented for `T`
50    = note: required for `impl Into<u32>` to implement `Into<impl Debug>`
51
52 error[E0277]: the trait bound `impl Debug: From<impl Into<u32>>` is not satisfied
53   --> $DIR/nested_impl_trait.rs:19:34
54    |
55 LL |     fn bad(x: impl Into<u32>) -> impl Into<impl Debug> { x }
56    |                                  ^^^^^^^^^^^^^^^^^^^^^ the trait `From<impl Into<u32>>` is not implemented for `impl Debug`
57    |
58    = help: the trait `Into<U>` is implemented for `T`
59    = note: required for `impl Into<u32>` to implement `Into<impl Debug>`
60
61 error: aborting due to 7 previous errors
62
63 Some errors have detailed explanations: E0277, E0562, E0666.
64 For more information about an error, try `rustc --explain E0277`.