@@ -7,11 +7,11 @@ at the field granularity:
7
7
``` rust,ignore
8
8
fn foo() {
9
9
let a: (Vec<u32>, Vec<u32>) = (vec![22], vec![44]);
10
-
10
+
11
11
// a.0 and a.1 are both initialized
12
-
12
+
13
13
let b = a.0; // moves a.0
14
-
14
+
15
15
// a.0 is not initialized, but a.1 still is
16
16
17
17
let c = a.0; // ERROR
@@ -73,7 +73,7 @@ there is no need for a [`MovePathIndex`]. Some examples:
73
73
there would be no move-path for ` foo[1] ` .
74
74
- You cannot move from inside of a borrowed reference, so if we have e.g. ` foo: &String ` ,
75
75
there would be no move-path for ` *foo ` .
76
-
76
+
77
77
These rules are enforced by the [ ` move_path_for ` ] function, which
78
78
converts a [ ` Place ` ] into a [ ` MovePathIndex ` ] -- in error cases like
79
79
those just discussed, the function returns an ` Err ` . This in turn
@@ -102,7 +102,7 @@ of [`MoveData`]. There are two different methods:
102
102
[ ` LookupResult ` ] indicating the closest path it was able to find
103
103
that exists (e.g., for ` foo[1] ` , it might return just the path for
104
104
` foo ` ).
105
-
105
+
106
106
[ `find` ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/dataflow/move_paths/struct.MovePathLookup.html#method.find
107
107
[ `find_local` ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/dataflow/move_paths/struct.MovePathLookup.html#method.find_local
108
108
[ `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
118
118
you might iterate to find the path ` a.b.c ` (here you are iterating
119
119
just over the paths that are ** actually referenced** in the source,
120
120
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 .
125
125
126
126
[ `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