]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr
:arrow_up: rust-analyzer
[rust.git] / src / test / ui / traits / associated_type_bound / assoc_type_bound_with_struct.stderr
1 error[E0433]: failed to resolve: use of undeclared type `Unresolved`
2   --> $DIR/assoc_type_bound_with_struct.rs:19:31
3    |
4 LL | fn issue_95327() where <u8 as Unresolved>::Assoc: String {}
5    |                               ^^^^^^^^^^ use of undeclared type `Unresolved`
6
7 error[E0404]: expected trait, found struct `String`
8   --> $DIR/assoc_type_bound_with_struct.rs:5:46
9    |
10 LL | struct Foo<T> where T: Bar, <T as Bar>::Baz: String {
11    |                                              ^^^^^^ not a trait
12    |
13   ::: $SRC_DIR/alloc/src/string.rs:LL:COL
14    |
15 LL | pub trait ToString {
16    | ------------------ similarly named trait `ToString` defined here
17    |
18 help: constrain the associated type to `String`
19    |
20 LL | struct Foo<T> where T: Bar, T: Bar<Baz = String> {
21    |                             ~~~~~~~~~~~~~~~~~~~~
22 help: a trait with a similar name exists
23    |
24 LL | struct Foo<T> where T: Bar, <T as Bar>::Baz: ToString {
25    |                                              ~~~~~~~~
26
27 error[E0404]: expected trait, found struct `String`
28   --> $DIR/assoc_type_bound_with_struct.rs:9:54
29    |
30 LL | struct Qux<'a, T> where T: Bar, <&'a T as Bar>::Baz: String {
31    |                                                      ^^^^^^ not a trait
32    |
33   ::: $SRC_DIR/alloc/src/string.rs:LL:COL
34    |
35 LL | pub trait ToString {
36    | ------------------ similarly named trait `ToString` defined here
37    |
38 help: constrain the associated type to `String`
39    |
40 LL | struct Qux<'a, T> where T: Bar, &'a T: Bar<Baz = String> {
41    |                                 ~~~~~~~~~~~~~~~~~~~~~~~~
42 help: a trait with a similar name exists
43    |
44 LL | struct Qux<'a, T> where T: Bar, <&'a T as Bar>::Baz: ToString {
45    |                                                      ~~~~~~~~
46
47 error[E0404]: expected trait, found struct `String`
48   --> $DIR/assoc_type_bound_with_struct.rs:13:45
49    |
50 LL | fn foo<T: Bar>(_: T) where <T as Bar>::Baz: String {
51    |                                             ^^^^^^ not a trait
52    |
53   ::: $SRC_DIR/alloc/src/string.rs:LL:COL
54    |
55 LL | pub trait ToString {
56    | ------------------ similarly named trait `ToString` defined here
57    |
58 help: constrain the associated type to `String`
59    |
60 LL | fn foo<T: Bar>(_: T) where T: Bar<Baz = String> {
61    |                            ~~~~~~~~~~~~~~~~~~~~
62 help: a trait with a similar name exists
63    |
64 LL | fn foo<T: Bar>(_: T) where <T as Bar>::Baz: ToString {
65    |                                             ~~~~~~~~
66
67 error[E0404]: expected trait, found struct `String`
68   --> $DIR/assoc_type_bound_with_struct.rs:16:57
69    |
70 LL | fn qux<'a, T: Bar>(_: &'a T) where <&'a T as Bar>::Baz: String {
71    |                                                         ^^^^^^ not a trait
72    |
73   ::: $SRC_DIR/alloc/src/string.rs:LL:COL
74    |
75 LL | pub trait ToString {
76    | ------------------ similarly named trait `ToString` defined here
77    |
78 help: constrain the associated type to `String`
79    |
80 LL | fn qux<'a, T: Bar>(_: &'a T) where &'a T: Bar<Baz = String> {
81    |                                    ~~~~~~~~~~~~~~~~~~~~~~~~
82 help: a trait with a similar name exists
83    |
84 LL | fn qux<'a, T: Bar>(_: &'a T) where <&'a T as Bar>::Baz: ToString {
85    |                                                         ~~~~~~~~
86
87 error[E0404]: expected trait, found struct `String`
88   --> $DIR/assoc_type_bound_with_struct.rs:19:51
89    |
90 LL | fn issue_95327() where <u8 as Unresolved>::Assoc: String {}
91    |                                                   ^^^^^^ help: a trait with a similar name exists: `ToString`
92    |
93   ::: $SRC_DIR/alloc/src/string.rs:LL:COL
94    |
95 LL | pub trait ToString {
96    | ------------------ similarly named trait `ToString` defined here
97
98 error: aborting due to 6 previous errors
99
100 Some errors have detailed explanations: E0404, E0433.
101 For more information about an error, try `rustc --explain E0404`.