Commit 54ea8e1
authored
Rollup merge of rust-lang#81922 - magurotuna:issue81522, r=matthewjasper
Let `#[allow(unstable_name_collisions)]` work for things other than function
Fixes rust-lang#81522
In addition to the report in rust-lang#81522, currently `#[allow(unstable_name_collisions)]` doesn't suppress the corresponding diagnostics even if this attribute is appended to an expression statement or a let statement. It seems like this is because the wrong `HirId` is passed to `struct_span_lint_hir`.
It's fixed in this PR, and a regression test for it is also added.File tree
2 files changed
+38
-1
lines changed- compiler/rustc_typeck/src/check/method
- src/test/ui/inference
2 files changed
+38
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
| |||
448 | 450 | | |
449 | 451 | | |
450 | 452 | | |
| 453 | + | |
451 | 454 | | |
452 | 455 | | |
453 | 456 | | |
| |||
547 | 550 | | |
548 | 551 | | |
549 | 552 | | |
| 553 | + | |
550 | 554 | | |
551 | 555 | | |
552 | 556 | | |
| |||
564 | 568 | | |
565 | 569 | | |
566 | 570 | | |
| 571 | + | |
567 | 572 | | |
568 | 573 | | |
569 | 574 | | |
| |||
1312 | 1317 | | |
1313 | 1318 | | |
1314 | 1319 | | |
1315 | | - | |
| 1320 | + | |
1316 | 1321 | | |
1317 | 1322 | | |
1318 | 1323 | | |
| |||
1594 | 1599 | | |
1595 | 1600 | | |
1596 | 1601 | | |
| 1602 | + | |
1597 | 1603 | | |
1598 | 1604 | | |
1599 | 1605 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
0 commit comments