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