-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Commit d78be31
authored
Rollup merge of #127888 - estebank:type-param-sugg, r=compiler-errors
More accurate span for type parameter suggestion
After:
```
error[E0229]: associated item constraints are not allowed here
--> $DIR/impl-block-params-declared-in-wrong-spot-issue-113073.rs:3:10
|
LL | impl Foo<T: Default> for String {}
| ^^^^^^^^^^ associated item constraint not allowed here
|
help: declare the type parameter right after the `impl` keyword
|
LL - impl Foo<T: Default> for String {}
LL + impl<T: Default> Foo<T> for String {}
|
```
Before:
```
error[E0229]: associated item constraints are not allowed here
--> $DIR/impl-block-params-declared-in-wrong-spot-issue-113073.rs:3:10
|
LL | impl Foo<T: Default> for String {}
| ^^^^^^^^^^ associated item constraint not allowed here
|
help: declare the type parameter right after the `impl` keyword
|
LL | impl<T: Default> Foo<T> for String {}
| ++++++++++++ ~
```File tree
2 files changed
+23
-15
lines changed- compiler/rustc_hir_analysis/src/hir_ty_lowering
- tests/ui/generics
2 files changed
+23
-15
lines changedLines changed: 5 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1338 | 1338 |
| |
1339 | 1339 |
| |
1340 | 1340 |
| |
1341 | - | ||
1342 | - | ||
1341 | + | ||
1342 | + | ||
1343 | + | ||
1344 | + | ||
1343 | 1345 |
| |
1344 | 1346 |
| |
1345 | - | ||
1347 | + | ||
1346 | 1348 |
| |
1347 | 1349 |
| |
1348 | 1350 |
| |
|
Lines changed: 18 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
17 | - | ||
18 | - | ||
17 | + | ||
18 | + | ||
19 | + | ||
19 | 20 |
| |
20 | 21 |
| |
21 | 22 |
| |
| |||
25 | 26 |
| |
26 | 27 |
| |
27 | 28 |
| |
28 | - | ||
29 | - | ||
29 | + | ||
30 | + | ||
31 | + | ||
30 | 32 |
| |
31 | 33 |
| |
32 | 34 |
| |
| |||
36 | 38 |
| |
37 | 39 |
| |
38 | 40 |
| |
39 | - | ||
40 | - | ||
41 | + | ||
42 | + | ||
43 | + | ||
41 | 44 |
| |
42 | 45 |
| |
43 | 46 |
| |
| |||
47 | 50 |
| |
48 | 51 |
| |
49 | 52 |
| |
50 | - | ||
51 | - | ||
53 | + | ||
54 | + | ||
55 | + | ||
52 | 56 |
| |
53 | 57 |
| |
54 | 58 |
| |
| |||
58 | 62 |
| |
59 | 63 |
| |
60 | 64 |
| |
61 | - | ||
62 | - | ||
65 | + | ||
66 | + | ||
67 | + | ||
63 | 68 |
| |
64 | 69 |
| |
65 | 70 |
| |
| |||
87 | 92 |
| |
88 | 93 |
| |
89 | 94 |
| |
90 | - | ||
91 | - | ||
95 | + | ||
96 | + | ||
97 | + | ||
92 | 98 |
| |
93 | 99 |
| |
94 | 100 |
| |
|
0 commit comments