]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/not_a_defining_use.stderr
Merge commit '35d9c6bf256968e1b40e0d554607928bdf9cebea' into sync_cg_clif-2022-02-23
[rust.git] / src / test / ui / type-alias-impl-trait / not_a_defining_use.stderr
1 error: non-defining opaque type use in defining scope
2   --> $DIR/not_a_defining_use.rs:10:27
3    |
4 LL | fn two<T: Debug>(t: T) -> Two<T, u32> {
5    |                           ^^^^^^^^^^^
6    |
7 note: used non-generic type `u32` for generic parameter
8   --> $DIR/not_a_defining_use.rs:7:13
9    |
10 LL | type Two<T, U> = impl Debug;
11    |             ^
12
13 error: concrete type differs from previous defining opaque type use
14   --> $DIR/not_a_defining_use.rs:29:1
15    |
16 LL | fn four<T: Debug, U: Bar>(t: T) -> Two<T, U> {
17    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(T, i8)`, got `(T, <U as Bar>::Blub)`
18    |
19 note: previous use here
20   --> $DIR/not_a_defining_use.rs:15:1
21    |
22 LL | fn three<T: Debug, U>(t: T) -> Two<T, U> {
23    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24
25 error[E0277]: `T` doesn't implement `Debug`
26   --> $DIR/not_a_defining_use.rs:7:18
27    |
28 LL | type Two<T, U> = impl Debug;
29    |                  ^^^^^^^^^^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
30    |
31    = note: required because of the requirements on the impl of `Debug` for `(T, i8)`
32 help: consider restricting type parameter `T`
33    |
34 LL | type Two<T: std::fmt::Debug, U> = impl Debug;
35    |           +++++++++++++++++
36
37 error: aborting due to 3 previous errors
38
39 For more information about this error, try `rustc --explain E0277`.