Commit 21ac19d
committed
Auto merge of #57304 - davidtwco:issue-57280, r=nikomatsakis
NLL: Fix bug in associated constant type annotations.
Fixes #57280.
This PR reverses the variance used when relating types from the type
annotation of an associated constant - this matches the behaviour of the
lexical borrow checker and fixes a bug whereby matching a `&'a str`
against a `&'static str` would produce an error.
r? @nikomatsakisFile tree
6 files changed
+106
-4
lines changed- src
- librustc_mir
- build/matches
- hair
- cx
- pattern
- test/ui/nll
6 files changed
+106
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
| 287 | + | |
287 | 288 | | |
288 | 289 | | |
289 | 290 | | |
| |||
310 | 311 | | |
311 | 312 | | |
312 | 313 | | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
313 | 328 | | |
314 | 329 | | |
315 | 330 | | |
| |||
541 | 556 | | |
542 | 557 | | |
543 | 558 | | |
544 | | - | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
545 | 565 | | |
546 | 566 | | |
547 | 567 | | |
548 | 568 | | |
549 | 569 | | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
550 | 573 | | |
551 | 574 | | |
552 | 575 | | |
| |||
628 | 651 | | |
629 | 652 | | |
630 | 653 | | |
| 654 | + | |
631 | 655 | | |
632 | 656 | | |
633 | 657 | | |
| |||
1321 | 1345 | | |
1322 | 1346 | | |
1323 | 1347 | | |
1324 | | - | |
| 1348 | + | |
1325 | 1349 | | |
1326 | 1350 | | |
1327 | 1351 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
60 | 67 | | |
61 | 68 | | |
62 | 69 | | |
63 | 70 | | |
| 71 | + | |
64 | 72 | | |
65 | 73 | | |
66 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
89 | | - | |
| 90 | + | |
| 91 | + | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
94 | 113 | | |
95 | 114 | | |
96 | 115 | | |
| |||
714 | 733 | | |
715 | 734 | | |
716 | 735 | | |
| 736 | + | |
717 | 737 | | |
718 | 738 | | |
719 | 739 | | |
| |||
763 | 783 | | |
764 | 784 | | |
765 | 785 | | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
766 | 789 | | |
767 | 790 | | |
768 | 791 | | |
| |||
1057 | 1080 | | |
1058 | 1081 | | |
1059 | 1082 | | |
| 1083 | + | |
1060 | 1084 | | |
1061 | 1085 | | |
1062 | 1086 | | |
1063 | 1087 | | |
1064 | 1088 | | |
| 1089 | + | |
1065 | 1090 | | |
1066 | 1091 | | |
1067 | 1092 | | |
| |||
| 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 | + | |
| 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 | + | |
0 commit comments