File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
src/librustc_mir/dataflow/impls Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,13 @@ use crate::dataflow::{self, GenKillSet};
10
10
/// indirectly. This could either be a mutable reference (`&mut`) or a shared borrow if the type of
11
11
/// that `Local` allows interior mutability.
12
12
///
13
- /// If this returns `false` for a `Local` at a given `Location`, the user can assume that `Local`
14
- /// has not been mutated as a result of an indirect assignment (`*p = x`) or as a side-effect of a
15
- /// function call or drop terminator.
13
+ /// If this returns false for a `Local` at the location of an indirect assignment, that `Local`
14
+ /// cannot be mutated by that assignment. For example, if the dataflow state at a statement like
15
+ /// `*p = 42` contained locals `x` and `z` but not `y`, we know that while `x` or `z` may be the
16
+ /// target of that assignment, `y` cannot be.
17
+ ///
18
+ /// Assignments through a pointer are not the only place where a `Local` can be mutated indirectly:
19
+ /// Function calls, drop terminators and inline assembly can all mutate `Local`s as a side-effect.
16
20
#[ derive( Copy , Clone ) ]
17
21
pub struct IndirectlyMutableLocals < ' mir , ' tcx > {
18
22
body : & ' mir mir:: Body < ' tcx > ,
You can’t perform that action at this time.
0 commit comments