@@ -2,48 +2,48 @@ error: expected identifier, found keyword `fn`
22  --> $DIR/kw-in-trait-bounds.rs:3:10
33   |
44LL | fn _f<F: fn(), G>(_: impl fn(), _: &dyn fn())
5-    |          ^^ expected identifier, found keyword 
5+    |          ^^
66   |
7- help: escape `fn ` to use it as an identifier 
7+ help: use `Fn ` to refer to the trait 
88   |
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+    |          ~~ 
1111
1212error: expected identifier, found keyword `fn`
1313  --> $DIR/kw-in-trait-bounds.rs:3:27
1414   |
1515LL | fn _f<F: fn(), G>(_: impl fn(), _: &dyn fn())
16-    |                           ^^ expected identifier, found keyword 
16+    |                           ^^
1717   |
18- help: escape `fn ` to use it as an identifier 
18+ help: use `Fn ` to refer to the trait 
1919   |
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+    |                           ~~ 
2222
2323error: expected identifier, found keyword `fn`
2424  --> $DIR/kw-in-trait-bounds.rs:3:41
2525   |
2626LL | fn _f<F: fn(), G>(_: impl fn(), _: &dyn fn())
27-    |                                         ^^ expected identifier, found keyword 
27+    |                                         ^^
2828   |
29- help: escape `fn ` to use it as an identifier 
29+ help: use `Fn ` to refer to the trait 
3030   |
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+    |                                         ~~ 
3333
3434error: expected identifier, found keyword `fn`
35-   --> $DIR/kw-in-trait-bounds.rs:17 :4
35+   --> $DIR/kw-in-trait-bounds.rs:11 :4
3636   |
3737LL | G: fn(),
38-    |    ^^ expected identifier, found keyword 
38+    |    ^^
3939   |
40- help: escape `fn ` to use it as an identifier 
40+ help: use `Fn ` to refer to the trait 
4141   |
42- LL | G: r#fn (),
43-    |    ++ 
42+ LL | G: Fn (),
43+    |    ~~ 
4444
4545error: expected identifier, found keyword `struct`
46-   --> $DIR/kw-in-trait-bounds.rs:24 :10
46+   --> $DIR/kw-in-trait-bounds.rs:16 :10
4747   |
4848LL | fn _g<A: struct, B>(_: impl struct, _: &dyn struct)
4949   |          ^^^^^^ expected identifier, found keyword
@@ -54,7 +54,7 @@ LL | fn _g<A: r#struct, B>(_: impl struct, _: &dyn struct)
5454   |          ++
5555
5656error: expected identifier, found keyword `struct`
57-   --> $DIR/kw-in-trait-bounds.rs:24 :29
57+   --> $DIR/kw-in-trait-bounds.rs:16 :29
5858   |
5959LL | fn _g<A: struct, B>(_: impl struct, _: &dyn struct)
6060   |                             ^^^^^^ expected identifier, found keyword
@@ -65,7 +65,7 @@ LL | fn _g<A: struct, B>(_: impl r#struct, _: &dyn struct)
6565   |                             ++
6666
6767error: expected identifier, found keyword `struct`
68-   --> $DIR/kw-in-trait-bounds.rs:24 :45
68+   --> $DIR/kw-in-trait-bounds.rs:16 :45
6969   |
7070LL | fn _g<A: struct, B>(_: impl struct, _: &dyn struct)
7171   |                                             ^^^^^^ expected identifier, found keyword
@@ -76,7 +76,7 @@ LL | fn _g<A: struct, B>(_: impl struct, _: &dyn r#struct)
7676   |                                             ++
7777
7878error: expected identifier, found keyword `struct`
79-   --> $DIR/kw-in-trait-bounds.rs:38 :8
79+   --> $DIR/kw-in-trait-bounds.rs:30 :8
8080   |
8181LL |     B: struct,
8282   |        ^^^^^^ expected identifier, found keyword
@@ -86,44 +86,8 @@ help: escape `struct` to use it as an identifier
8686LL |     B: r#struct,
8787   |        ++
8888
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- 
12589error[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
12791   |
12892LL | fn _g<A: struct, B>(_: impl struct, _: &dyn struct)
12993   |          ^^^^^^ help: a trait with a similar name exists (notice the capitalization): `Struct`
@@ -132,7 +96,7 @@ LL | trait Struct {}
13296   | ------------ similarly named trait `Struct` defined here
13397
13498error[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
136100   |
137101LL |     B: struct,
138102   |        ^^^^^^ help: a trait with a similar name exists (notice the capitalization): `Struct`
@@ -141,7 +105,7 @@ LL | trait Struct {}
141105   | ------------ similarly named trait `Struct` defined here
142106
143107error[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
145109   |
146110LL | fn _g<A: struct, B>(_: impl struct, _: &dyn struct)
147111   |                             ^^^^^^ help: a trait with a similar name exists (notice the capitalization): `Struct`
@@ -150,14 +114,14 @@ LL | trait Struct {}
150114   | ------------ similarly named trait `Struct` defined here
151115
152116error[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
154118   |
155119LL | fn _g<A: struct, B>(_: impl struct, _: &dyn struct)
156120   |                                             ^^^^^^ help: a trait with a similar name exists (notice the capitalization): `Struct`
157121...
158122LL | trait Struct {}
159123   | ------------ similarly named trait `Struct` defined here
160124
161- error: aborting due to 16  previous errors
125+ error: aborting due to 12  previous errors
162126
163127For more information about this error, try `rustc --explain E0405`.
0 commit comments