Commit c0b47d9
authored
Rollup merge of #134474 - oli-obk:push-yomnkntvzlxw, r=compiler-errors
Forbid overwriting types in typeck
While trying to figure out some type setting logic in #134248 I realized that we sometimes set a type twice. While hopefully that would have been the same type, we didn't ensure that at all and just silently accepted it. So now we reject setting it twice, unless errors are happening, then we don't care.
Best reviewed commit by commit.
No behaviour change is intended.File tree
4 files changed
+33
-26
lines changed- compiler/rustc_hir_typeck/src/fn_ctxt
- tests/ui/pattern
4 files changed
+33
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | 149 | | |
160 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
161 | 164 | | |
162 | 165 | | |
163 | 166 | | |
| |||
1104 | 1107 | | |
1105 | 1108 | | |
1106 | 1109 | | |
1107 | | - | |
1108 | 1110 | | |
1109 | 1111 | | |
1110 | 1112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1750 | 1750 | | |
1751 | 1751 | | |
1752 | 1752 | | |
1753 | | - | |
| 1753 | + | |
1754 | 1754 | | |
1755 | 1755 | | |
1756 | | - | |
1757 | 1756 | | |
1758 | 1757 | | |
1759 | 1758 | | |
| |||
1785 | 1784 | | |
1786 | 1785 | | |
1787 | 1786 | | |
| 1787 | + | |
1788 | 1788 | | |
1789 | 1789 | | |
1790 | 1790 | | |
1791 | 1791 | | |
1792 | | - | |
| 1792 | + | |
| 1793 | + | |
1793 | 1794 | | |
1794 | 1795 | | |
1795 | 1796 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | | - | |
| 9 | + | |
8 | 10 | | |
9 | | - | |
10 | | - | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | | - | |
| 9 | + | |
8 | 10 | | |
9 | | - | |
10 | | - | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
0 commit comments