@@ -2,48 +2,48 @@ error: expected identifier, found keyword `fn`
2
2
--> $DIR/kw-in-trait-bounds.rs:3:10
3
3
|
4
4
LL | fn _f<F: fn(), G>(_: impl fn(), _: &dyn fn())
5
- | ^^ expected identifier, found keyword
5
+ | ^^
6
6
|
7
- help: escape `fn ` to use it as an identifier
7
+ help: use `Fn ` to refer to the trait
8
8
|
9
- LL | fn _f<F: r#fn (), G>(_: impl fn(), _: &dyn fn())
10
- | ++
9
+ LL | fn _f<F: Fn (), G>(_: impl fn(), _: &dyn fn())
10
+ | ~~
11
11
12
12
error: expected identifier, found keyword `fn`
13
13
--> $DIR/kw-in-trait-bounds.rs:3:27
14
14
|
15
15
LL | fn _f<F: fn(), G>(_: impl fn(), _: &dyn fn())
16
- | ^^ expected identifier, found keyword
16
+ | ^^
17
17
|
18
- help: escape `fn ` to use it as an identifier
18
+ help: use `Fn ` to refer to the trait
19
19
|
20
- LL | fn _f<F: fn(), G>(_: impl r#fn (), _: &dyn fn())
21
- | ++
20
+ LL | fn _f<F: fn(), G>(_: impl Fn (), _: &dyn fn())
21
+ | ~~
22
22
23
23
error: expected identifier, found keyword `fn`
24
24
--> $DIR/kw-in-trait-bounds.rs:3:41
25
25
|
26
26
LL | fn _f<F: fn(), G>(_: impl fn(), _: &dyn fn())
27
- | ^^ expected identifier, found keyword
27
+ | ^^
28
28
|
29
- help: escape `fn ` to use it as an identifier
29
+ help: use `Fn ` to refer to the trait
30
30
|
31
- LL | fn _f<F: fn(), G>(_: impl fn(), _: &dyn r#fn ())
32
- | ++
31
+ LL | fn _f<F: fn(), G>(_: impl fn(), _: &dyn Fn ())
32
+ | ~~
33
33
34
34
error: expected identifier, found keyword `fn`
35
- --> $DIR/kw-in-trait-bounds.rs:17 :4
35
+ --> $DIR/kw-in-trait-bounds.rs:11 :4
36
36
|
37
37
LL | G: fn(),
38
- | ^^ expected identifier, found keyword
38
+ | ^^
39
39
|
40
- help: escape `fn ` to use it as an identifier
40
+ help: use `Fn ` to refer to the trait
41
41
|
42
- LL | G: r#fn (),
43
- | ++
42
+ LL | G: Fn (),
43
+ | ~~
44
44
45
45
error: expected identifier, found keyword `struct`
46
- --> $DIR/kw-in-trait-bounds.rs:24 :10
46
+ --> $DIR/kw-in-trait-bounds.rs:16 :10
47
47
|
48
48
LL | fn _g<A: struct, B>(_: impl struct, _: &dyn struct)
49
49
| ^^^^^^ expected identifier, found keyword
@@ -54,7 +54,7 @@ LL | fn _g<A: r#struct, B>(_: impl struct, _: &dyn struct)
54
54
| ++
55
55
56
56
error: expected identifier, found keyword `struct`
57
- --> $DIR/kw-in-trait-bounds.rs:24 :29
57
+ --> $DIR/kw-in-trait-bounds.rs:16 :29
58
58
|
59
59
LL | fn _g<A: struct, B>(_: impl struct, _: &dyn struct)
60
60
| ^^^^^^ expected identifier, found keyword
@@ -65,7 +65,7 @@ LL | fn _g<A: struct, B>(_: impl r#struct, _: &dyn struct)
65
65
| ++
66
66
67
67
error: expected identifier, found keyword `struct`
68
- --> $DIR/kw-in-trait-bounds.rs:24 :45
68
+ --> $DIR/kw-in-trait-bounds.rs:16 :45
69
69
|
70
70
LL | fn _g<A: struct, B>(_: impl struct, _: &dyn struct)
71
71
| ^^^^^^ expected identifier, found keyword
@@ -76,7 +76,7 @@ LL | fn _g<A: struct, B>(_: impl struct, _: &dyn r#struct)
76
76
| ++
77
77
78
78
error: expected identifier, found keyword `struct`
79
- --> $DIR/kw-in-trait-bounds.rs:38 :8
79
+ --> $DIR/kw-in-trait-bounds.rs:30 :8
80
80
|
81
81
LL | B: struct,
82
82
| ^^^^^^ expected identifier, found keyword
@@ -86,44 +86,8 @@ help: escape `struct` to use it as an identifier
86
86
LL | B: r#struct,
87
87
| ++
88
88
89
- error[E0405]: cannot find trait `r#fn` in this scope
90
- --> $DIR/kw-in-trait-bounds.rs:3:10
91
- |
92
- LL | fn _f<F: fn(), G>(_: impl fn(), _: &dyn fn())
93
- | ^^ help: a trait with a similar name exists (notice the capitalization): `Fn`
94
- --> $SRC_DIR/core/src/ops/function.rs:LL:COL
95
- |
96
- = note: similarly named trait `Fn` defined here
97
-
98
- error[E0405]: cannot find trait `r#fn` in this scope
99
- --> $DIR/kw-in-trait-bounds.rs:17:4
100
- |
101
- LL | G: fn(),
102
- | ^^ help: a trait with a similar name exists (notice the capitalization): `Fn`
103
- --> $SRC_DIR/core/src/ops/function.rs:LL:COL
104
- |
105
- = note: similarly named trait `Fn` defined here
106
-
107
- error[E0405]: cannot find trait `r#fn` in this scope
108
- --> $DIR/kw-in-trait-bounds.rs:3:27
109
- |
110
- LL | fn _f<F: fn(), G>(_: impl fn(), _: &dyn fn())
111
- | ^^ help: a trait with a similar name exists (notice the capitalization): `Fn`
112
- --> $SRC_DIR/core/src/ops/function.rs:LL:COL
113
- |
114
- = note: similarly named trait `Fn` defined here
115
-
116
- error[E0405]: cannot find trait `r#fn` in this scope
117
- --> $DIR/kw-in-trait-bounds.rs:3:41
118
- |
119
- LL | fn _f<F: fn(), G>(_: impl fn(), _: &dyn fn())
120
- | ^^ help: a trait with a similar name exists (notice the capitalization): `Fn`
121
- --> $SRC_DIR/core/src/ops/function.rs:LL:COL
122
- |
123
- = note: similarly named trait `Fn` defined here
124
-
125
89
error[E0405]: cannot find trait `r#struct` in this scope
126
- --> $DIR/kw-in-trait-bounds.rs:24 :10
90
+ --> $DIR/kw-in-trait-bounds.rs:16 :10
127
91
|
128
92
LL | fn _g<A: struct, B>(_: impl struct, _: &dyn struct)
129
93
| ^^^^^^ help: a trait with a similar name exists (notice the capitalization): `Struct`
@@ -132,7 +96,7 @@ LL | trait Struct {}
132
96
| ------------ similarly named trait `Struct` defined here
133
97
134
98
error[E0405]: cannot find trait `r#struct` in this scope
135
- --> $DIR/kw-in-trait-bounds.rs:38 :8
99
+ --> $DIR/kw-in-trait-bounds.rs:30 :8
136
100
|
137
101
LL | B: struct,
138
102
| ^^^^^^ help: a trait with a similar name exists (notice the capitalization): `Struct`
@@ -141,7 +105,7 @@ LL | trait Struct {}
141
105
| ------------ similarly named trait `Struct` defined here
142
106
143
107
error[E0405]: cannot find trait `r#struct` in this scope
144
- --> $DIR/kw-in-trait-bounds.rs:24 :29
108
+ --> $DIR/kw-in-trait-bounds.rs:16 :29
145
109
|
146
110
LL | fn _g<A: struct, B>(_: impl struct, _: &dyn struct)
147
111
| ^^^^^^ help: a trait with a similar name exists (notice the capitalization): `Struct`
@@ -150,14 +114,14 @@ LL | trait Struct {}
150
114
| ------------ similarly named trait `Struct` defined here
151
115
152
116
error[E0405]: cannot find trait `r#struct` in this scope
153
- --> $DIR/kw-in-trait-bounds.rs:24 :45
117
+ --> $DIR/kw-in-trait-bounds.rs:16 :45
154
118
|
155
119
LL | fn _g<A: struct, B>(_: impl struct, _: &dyn struct)
156
120
| ^^^^^^ help: a trait with a similar name exists (notice the capitalization): `Struct`
157
121
...
158
122
LL | trait Struct {}
159
123
| ------------ similarly named trait `Struct` defined here
160
124
161
- error: aborting due to 16 previous errors
125
+ error: aborting due to 12 previous errors
162
126
163
127
For more information about this error, try `rustc --explain E0405`.
0 commit comments