Commit 6c358c6
committed
Auto merge of rust-lang#101241 - camsteffen:refactor-binding-annotations, r=cjgillot
`BindingAnnotation` refactor
* `ast::BindingMode` is deleted and replaced with `hir::BindingAnnotation` (which is moved to `ast`)
* `BindingAnnotation` is changed from an enum to a tuple struct e.g. `BindingAnnotation(ByRef::No, Mutability::Mut)`
* Associated constants added for convenience `BindingAnnotation::{NONE, REF, MUT, REF_MUT}`
One goal is to make it more clear that `BindingAnnotation` merely represents syntax `ref mut` and not the actual binding mode. This was especially confusing since we had `ast::BindingMode`->`hir::BindingAnnotation`->`thir::BindingMode`.
I wish there were more symmetry between `ByRef` and `Mutability` (variant) naming (maybe `Mutable::Yes`?), and I also don't love how long the name `BindingAnnotation` is, but this seems like the best compromise. Ideas welcome.File tree
61 files changed
+276
-331
lines changed- compiler
- rustc_ast_lowering/src
- rustc_ast_passes/src
- rustc_ast_pretty/src/pprust
- rustc_ast/src
- rustc_borrowck/src/diagnostics
- rustc_builtin_macros/src/deriving/generic
- rustc_expand/src
- rustc_hir_pretty/src
- rustc_hir/src
- rustc_lint/src
- rustc_middle/src/ty
- rustc_parse/src/parser
- rustc_passes/src
- rustc_resolve/src
- rustc_save_analysis/src
- rustc_trait_selection/src/traits/error_reporting
- rustc_typeck/src/check
- src/tools
- clippy
- clippy_lints/src
- loops
- matches
- methods
- misc_early
- utils
- clippy_utils/src
- tests/ui
- author
- rustfmt/src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
61 files changed
+276
-331
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
594 | 594 | | |
595 | 595 | | |
596 | 596 | | |
597 | | - | |
| 597 | + | |
598 | 598 | | |
599 | 599 | | |
600 | 600 | | |
| |||
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
688 | 721 | | |
689 | 722 | | |
690 | 723 | | |
| |||
713 | 746 | | |
714 | 747 | | |
715 | 748 | | |
716 | | - | |
| 749 | + | |
717 | 750 | | |
718 | 751 | | |
719 | 752 | | |
| |||
2228 | 2261 | | |
2229 | 2262 | | |
2230 | 2263 | | |
2231 | | - | |
| 2264 | + | |
2232 | 2265 | | |
2233 | 2266 | | |
2234 | 2267 | | |
| |||
2258 | 2291 | | |
2259 | 2292 | | |
2260 | 2293 | | |
2261 | | - | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
| 2304 | + | |
| 2305 | + | |
| 2306 | + | |
| 2307 | + | |
2262 | 2308 | | |
2263 | 2309 | | |
2264 | 2310 | | |
2265 | | - | |
| 2311 | + | |
2266 | 2312 | | |
2267 | 2313 | | |
2268 | 2314 | | |
2269 | 2315 | | |
2270 | 2316 | | |
2271 | 2317 | | |
2272 | 2318 | | |
2273 | | - | |
2274 | | - | |
2275 | | - | |
2276 | | - | |
2277 | | - | |
2278 | | - | |
2279 | | - | |
2280 | | - | |
2281 | | - | |
2282 | | - | |
2283 | | - | |
2284 | | - | |
2285 | | - | |
2286 | 2319 | | |
2287 | 2320 | | |
2288 | 2321 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
577 | 577 | | |
578 | 578 | | |
579 | 579 | | |
580 | | - | |
| 580 | + | |
581 | 581 | | |
582 | 582 | | |
583 | 583 | | |
| |||
671 | 671 | | |
672 | 672 | | |
673 | 673 | | |
674 | | - | |
| 674 | + | |
675 | 675 | | |
676 | 676 | | |
677 | 677 | | |
| |||
1433 | 1433 | | |
1434 | 1434 | | |
1435 | 1435 | | |
1436 | | - | |
| 1436 | + | |
1437 | 1437 | | |
1438 | 1438 | | |
1439 | 1439 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1083 | 1083 | | |
1084 | 1084 | | |
1085 | 1085 | | |
1086 | | - | |
1087 | | - | |
1088 | | - | |
1089 | | - | |
1090 | | - | |
1091 | | - | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
1092 | 1089 | | |
1093 | 1090 | | |
1094 | 1091 | | |
| |||
1153 | 1150 | | |
1154 | 1151 | | |
1155 | 1152 | | |
1156 | | - | |
| 1153 | + | |
1157 | 1154 | | |
1158 | 1155 | | |
1159 | 1156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1692 | 1692 | | |
1693 | 1693 | | |
1694 | 1694 | | |
1695 | | - | |
1696 | 1695 | | |
1697 | 1696 | | |
1698 | | - | |
| 1697 | + | |
1699 | 1698 | | |
1700 | 1699 | | |
1701 | 1700 | | |
| |||
2360 | 2359 | | |
2361 | 2360 | | |
2362 | 2361 | | |
2363 | | - | |
| 2362 | + | |
2364 | 2363 | | |
2365 | 2364 | | |
2366 | 2365 | | |
2367 | | - | |
| 2366 | + | |
2368 | 2367 | | |
2369 | 2368 | | |
2370 | 2369 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
180 | 180 | | |
181 | | - | |
| 181 | + | |
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
| 197 | + | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
| 212 | + | |
213 | 213 | | |
214 | | - | |
| 214 | + | |
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
| 238 | + | |
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
| 251 | + | |
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | 272 | | |
282 | 273 | | |
283 | 274 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
284 | | - | |
285 | | - | |
| 284 | + | |
| 285 | + | |
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
| 14 | + | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
1399 | 1399 | | |
1400 | 1400 | | |
1401 | 1401 | | |
1402 | | - | |
1403 | | - | |
1404 | | - | |
1405 | | - | |
1406 | | - | |
1407 | | - | |
1408 | | - | |
1409 | | - | |
1410 | | - | |
1411 | | - | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
1412 | 1408 | | |
1413 | 1409 | | |
1414 | 1410 | | |
| |||
1487 | 1483 | | |
1488 | 1484 | | |
1489 | 1485 | | |
1490 | | - | |
| 1486 | + | |
1491 | 1487 | | |
1492 | 1488 | | |
1493 | | - | |
1494 | | - | |
1495 | | - | |
| 1489 | + | |
1496 | 1490 | | |
1497 | 1491 | | |
1498 | 1492 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
370 | | - | |
| 370 | + | |
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
| |||
0 commit comments