Commit 3bfd712
authored
Rollup merge of rust-lang#147575 - beepster4096:movesubpath, r=oli-obk
Refactor move analysis subpath representation
Follow up to rust-lang#147055
This PR does two things:
1. Document/validate move analysis's assumptions about `Subslice` projections
2. Decouple move paths from `ProjectionElem`, using a new enum `MoveSubPath` instead
- This would be needed eventually when `ProjectionElem::Deref` is removed
I wanted to do even more abstraction, making `MovePathLookup::find` return an iterator to remove the special handling of subslices in borrowck, but that regressed diagnostics and just wasn't worth the complexity.File tree
5 files changed
+341
-195
lines changed- compiler
- rustc_middle/src/mir
- rustc_mir_dataflow/src/move_paths
- rustc_mir_transform/src
- src/doc/rustc-dev-guide/src/borrow_check/moves_and_initialization
5 files changed
+341
-195
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| 140 | + | |
140 | 141 | | |
141 | 142 | | |
142 | 143 | | |
| |||
1246 | 1247 | | |
1247 | 1248 | | |
1248 | 1249 | | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
1249 | 1253 | | |
1250 | 1254 | | |
1251 | 1255 | | |
| |||
0 commit comments