Skip to content

Commit ffd9c04

Browse files
committed
Merge remote-tracking branch 'rustc-guide/ecstatic-morse-patch-1' into rustc-middle
2 parents 748f767 + 311882a commit ffd9c04

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/borrow_check/moves_and_initialization/move_paths.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ at the field granularity:
77
```rust,ignore
88
fn foo() {
99
let a: (Vec<u32>, Vec<u32>) = (vec![22], vec![44]);
10-
10+
1111
// a.0 and a.1 are both initialized
12-
12+
1313
let b = a.0; // moves a.0
14-
14+
1515
// a.0 is not initialized, but a.1 still is
1616
1717
let c = a.0; // ERROR
@@ -73,7 +73,7 @@ there is no need for a [`MovePathIndex`]. Some examples:
7373
there would be no move-path for `foo[1]`.
7474
- You cannot move from inside of a borrowed reference, so if we have e.g. `foo: &String`,
7575
there would be no move-path for `*foo`.
76-
76+
7777
These rules are enforced by the [`move_path_for`] function, which
7878
converts a [`Place`] into a [`MovePathIndex`] -- in error cases like
7979
those just discussed, the function returns an `Err`. This in turn
@@ -102,7 +102,7 @@ of [`MoveData`]. There are two different methods:
102102
[`LookupResult`] indicating the closest path it was able to find
103103
that exists (e.g., for `foo[1]`, it might return just the path for
104104
`foo`).
105-
105+
106106
[`find`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/dataflow/move_paths/struct.MovePathLookup.html#method.find
107107
[`find_local`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/dataflow/move_paths/struct.MovePathLookup.html#method.find_local
108108
[`mir::Local`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/struct.Local.html
@@ -118,10 +118,10 @@ they are also structured into a tree. So for example if you have the
118118
you might iterate to find the path `a.b.c` (here you are iterating
119119
just over the paths that are **actually referenced** in the source,
120120
not all **possible** paths that could have been referenced). These
121-
references are used for example in the [`has_any_child_of`] function,
122-
which checks whether the dataflow results contain a value for the
123-
given move-path (e.g., `a.b`) or any child of that move-path (e.g.,
124-
`a.b.c`).
121+
references are used for example in the
122+
[`find_in_move_path_or_its_descendants`] function, which determines
123+
whether a move-path (e.g., `a.b`) or any child of that move-path
124+
(e.g.,`a.b.c`) matches a given predicate.
125125

126126
[`Place`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/struct.Place.html
127-
[`has_any_child_of`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/dataflow/at_location/struct.FlowAtLocation.html#method.has_any_child_of
127+
[`find_in_move_path_or_its_descendants`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/dataflow/move_paths/struct.MoveData.html#method.find_in_move_path_or_its_descendants

0 commit comments

Comments
 (0)