Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d255962
Auto merge of #147392 - tshepang:rdg-sync, r=tshepang
bors Oct 6, 2025
02c7c42
Rollup merge of #146874 - Enselic:multiple-adt-versions, r=jieyouxu
Zalathar Oct 6, 2025
b49485d
Rollup merge of #147237 - yotamofek:pr/rustdoc/highlight/optimize-end…
Zalathar Oct 6, 2025
541164f
Auto merge of #147397 - Zalathar:rollup-mioe9m4, r=Zalathar
bors Oct 6, 2025
80266a7
Auto merge of #144477 - cjgillot:gvn-index, r=dianqk
bors Oct 6, 2025
34839e1
Auto merge of #147099 - cjgillot:split-nop-landing, r=lcnr
bors Oct 7, 2025
4b2448d
Auto merge of #145608 - Darksonn:derefmut-pin-fix, r=lcnr
bors Oct 7, 2025
306e213
Auto merge of #147423 - nnethercote:DepNodeColor-tweaks, r=cjgillot
bors Oct 8, 2025
9bd6516
Auto merge of #143227 - tshepang:asm-label-operand, r=Amanieu
bors Oct 9, 2025
4e52541
Auto merge of #147124 - a1phyr:improve_finish_grow, r=Mark-Simulacrum
bors Oct 11, 2025
fc3da91
update movepath docs
beepster4096 Oct 10, 2025
6c47a42
Auto merge of #146096 - adwinwhite:handle_normalization_overflow_in_m…
bors Oct 13, 2025
89afab6
Auto merge of #147353 - the8472:nondrop-array-iter, r=scottmcm
bors Oct 14, 2025
3f75b40
Auto merge of #146221 - camsteffen:ast-boxes, r=cjgillot
bors Oct 16, 2025
8219fc1
Auto merge of #147508 - nnethercote:TaskDeps-improvements, r=saethlin
bors Oct 17, 2025
ac94a0a
Auto merge of #146913 - camsteffen:refactor-lint-syntax, r=fee1-dead
bors Oct 18, 2025
a53aa39
Rollup merge of #147575 - beepster4096:movesubpath, r=oli-obk
matthiaskrgr Oct 19, 2025
b7c71cc
Rollup merge of #147864 - fee1-dead-contrib:consttraitparse, r=fmease
matthiaskrgr Oct 19, 2025
cc7632e
Rollup merge of #147868 - cjgillot:patch-local, r=saethlin
matthiaskrgr Oct 19, 2025
16cf6e2
Rollup merge of #147873 - RalfJung:deduce_param_attrs, r=tmiasko
matthiaskrgr Oct 19, 2025
9e3b484
Auto merge of #147884 - matthiaskrgr:rollup-pjqcccz, r=matthiaskrgr
bors Oct 19, 2025
db31cae
Auto merge of #147812 - RalfJung:more-minicore, r=jieyouxu
bors Oct 19, 2025
730eb69
Prepare for merging from rust-lang/rust
invalid-email-address Oct 20, 2025
0cef2ff
Merge ref 'c0c37cafdcf7' from rust-lang/rust
invalid-email-address Oct 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4fa824bb78318a3cba8c7339d5754b4909922547
c0c37cafdcf74a8c8b53fe19c85d546c57437e98
14 changes: 12 additions & 2 deletions src/borrow_check/moves_and_initialization/move_paths.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ We don't actually create a move-path for **every** [`Place`] that gets
used. In particular, if it is illegal to move from a [`Place`], then
there is no need for a [`MovePathIndex`]. Some examples:

- You cannot move from a static variable, so we do not create a [`MovePathIndex`]
for static variables.
- You cannot move an individual element of an array, so if we have e.g. `foo: [String; 3]`,
there would be no move-path for `foo[1]`.
- You cannot move from inside of a borrowed reference, so if we have e.g. `foo: &String`,
Expand All @@ -82,6 +80,18 @@ initialized (which lowers overhead).

[`move_path_for`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_dataflow/move_paths/builder/struct.MoveDataBuilder.html#method.move_path_for

## Projections

Instead of using [`PlaceElem`], projections in move paths are stored as [`MoveSubPath`]s.
Projections that can't be moved out of and projections that can be skipped are not represented.

Subslice projections of arrays (produced by slice patterns) are special; they're turned into
multiple [`ConstantIndex`] subpaths, one for each element in the subslice.

[`PlaceElem`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/type.PlaceElem.html
[`MoveSubPath`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_dataflow/move_paths/enum.MoveSubPath.html
[`ConstantIndex`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir_dataflow/move_paths/enum.MoveSubPath.html#variant.ConstantIndex

## Looking up a move-path

If you have a [`Place`] and you would like to convert it to a [`MovePathIndex`], you
Expand Down