@@ -1034,10 +1034,10 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
1034
1034
}
1035
1035
1036
1036
hir:: ExprAssign ( ref l, ref r) => {
1037
- // see comment on lvalues in
1038
- // propagate_through_lvalue_components ()
1039
- let succ = self . write_lvalue ( & l, succ, ACC_WRITE ) ;
1040
- let succ = self . propagate_through_lvalue_components ( & l, succ) ;
1037
+ // see comment on places in
1038
+ // propagate_through_place_components ()
1039
+ let succ = self . write_place ( & l, succ, ACC_WRITE ) ;
1040
+ let succ = self . propagate_through_place_components ( & l, succ) ;
1041
1041
self . propagate_through_expr ( & r, succ)
1042
1042
}
1043
1043
@@ -1047,11 +1047,11 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
1047
1047
let succ = self . propagate_through_expr ( & l, succ) ;
1048
1048
self . propagate_through_expr ( & r, succ)
1049
1049
} else {
1050
- // see comment on lvalues in
1051
- // propagate_through_lvalue_components ()
1052
- let succ = self . write_lvalue ( & l, succ, ACC_WRITE |ACC_READ ) ;
1050
+ // see comment on places in
1051
+ // propagate_through_place_components ()
1052
+ let succ = self . write_place ( & l, succ, ACC_WRITE |ACC_READ ) ;
1053
1053
let succ = self . propagate_through_expr ( & r, succ) ;
1054
- self . propagate_through_lvalue_components ( & l, succ)
1054
+ self . propagate_through_place_components ( & l, succ)
1055
1055
}
1056
1056
}
1057
1057
@@ -1121,14 +1121,14 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
1121
1121
1122
1122
hir:: ExprInlineAsm ( ref ia, ref outputs, ref inputs) => {
1123
1123
let succ = ia. outputs . iter ( ) . zip ( outputs) . rev ( ) . fold ( succ, |succ, ( o, output) | {
1124
- // see comment on lvalues
1125
- // in propagate_through_lvalue_components ()
1124
+ // see comment on places
1125
+ // in propagate_through_place_components ()
1126
1126
if o. is_indirect {
1127
1127
self . propagate_through_expr ( output, succ)
1128
1128
} else {
1129
1129
let acc = if o. is_rw { ACC_WRITE |ACC_READ } else { ACC_WRITE } ;
1130
- let succ = self . write_lvalue ( output, succ, acc) ;
1131
- self . propagate_through_lvalue_components ( output, succ)
1130
+ let succ = self . write_place ( output, succ, acc) ;
1131
+ self . propagate_through_place_components ( output, succ)
1132
1132
}
1133
1133
} ) ;
1134
1134
@@ -1146,11 +1146,11 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
1146
1146
}
1147
1147
}
1148
1148
1149
- fn propagate_through_lvalue_components ( & mut self ,
1149
+ fn propagate_through_place_components ( & mut self ,
1150
1150
expr : & Expr ,
1151
1151
succ : LiveNode )
1152
1152
-> LiveNode {
1153
- // # Lvalues
1153
+ // # Places
1154
1154
//
1155
1155
// In general, the full flow graph structure for an
1156
1156
// assignment/move/etc can be handled in one of two ways,
@@ -1160,15 +1160,15 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
1160
1160
//
1161
1161
// The two kinds of graphs are:
1162
1162
//
1163
- // Tracked lvalue Untracked lvalue
1163
+ // Tracked place Untracked place
1164
1164
// ----------------------++-----------------------
1165
1165
// ||
1166
1166
// | || |
1167
1167
// v || v
1168
1168
// (rvalue) || (rvalue)
1169
1169
// | || |
1170
1170
// v || v
1171
- // (write of lvalue ) || (lvalue components)
1171
+ // (write of place ) || (place components)
1172
1172
// | || |
1173
1173
// v || v
1174
1174
// (succ) || (succ)
@@ -1177,25 +1177,25 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
1177
1177
//
1178
1178
// I will cover the two cases in turn:
1179
1179
//
1180
- // # Tracked lvalues
1180
+ // # Tracked places
1181
1181
//
1182
- // A tracked lvalue is a local variable/argument `x`. In
1182
+ // A tracked place is a local variable/argument `x`. In
1183
1183
// these cases, the link_node where the write occurs is linked
1184
- // to node id of `x`. The `write_lvalue ()` routine generates
1184
+ // to node id of `x`. The `write_place ()` routine generates
1185
1185
// the contents of this node. There are no subcomponents to
1186
1186
// consider.
1187
1187
//
1188
- // # Non-tracked lvalues
1188
+ // # Non-tracked places
1189
1189
//
1190
- // These are lvalues like `x[5]` or `x.f`. In that case, we
1190
+ // These are places like `x[5]` or `x.f`. In that case, we
1191
1191
// basically ignore the value which is written to but generate
1192
1192
// reads for the components---`x` in these two examples. The
1193
1193
// components reads are generated by
1194
- // `propagate_through_lvalue_components ()` (this fn).
1194
+ // `propagate_through_place_components ()` (this fn).
1195
1195
//
1196
- // # Illegal lvalues
1196
+ // # Illegal places
1197
1197
//
1198
- // It is still possible to observe assignments to non-lvalues ;
1198
+ // It is still possible to observe assignments to non-places ;
1199
1199
// these errors are detected in the later pass borrowck. We
1200
1200
// just ignore such cases and treat them as reads.
1201
1201
@@ -1207,17 +1207,17 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
1207
1207
}
1208
1208
}
1209
1209
1210
- // see comment on propagate_through_lvalue ()
1211
- fn write_lvalue ( & mut self , expr : & Expr , succ : LiveNode , acc : u32 )
1210
+ // see comment on propagate_through_place ()
1211
+ fn write_place ( & mut self , expr : & Expr , succ : LiveNode , acc : u32 )
1212
1212
-> LiveNode {
1213
1213
match expr. node {
1214
1214
hir:: ExprPath ( hir:: QPath :: Resolved ( _, ref path) ) => {
1215
1215
self . access_path ( expr. id , path, succ, acc)
1216
1216
}
1217
1217
1218
- // We do not track other lvalues , so just propagate through
1218
+ // We do not track other places , so just propagate through
1219
1219
// to their subcomponents. Also, it may happen that
1220
- // non-lvalues occur here, because those are detected in the
1220
+ // non-places occur here, because those are detected in the
1221
1221
// later pass borrowck.
1222
1222
_ => succ
1223
1223
}
@@ -1363,14 +1363,14 @@ fn check_arm<'a, 'tcx>(this: &mut Liveness<'a, 'tcx>, arm: &'tcx hir::Arm) {
1363
1363
fn check_expr < ' a , ' tcx > ( this : & mut Liveness < ' a , ' tcx > , expr : & ' tcx Expr ) {
1364
1364
match expr. node {
1365
1365
hir:: ExprAssign ( ref l, _) => {
1366
- this. check_lvalue ( & l) ;
1366
+ this. check_place ( & l) ;
1367
1367
1368
1368
intravisit:: walk_expr ( this, expr) ;
1369
1369
}
1370
1370
1371
1371
hir:: ExprAssignOp ( _, ref l, _) => {
1372
1372
if !this. tables . is_method_call ( expr) {
1373
- this. check_lvalue ( & l) ;
1373
+ this. check_place ( & l) ;
1374
1374
}
1375
1375
1376
1376
intravisit:: walk_expr ( this, expr) ;
@@ -1381,10 +1381,10 @@ fn check_expr<'a, 'tcx>(this: &mut Liveness<'a, 'tcx>, expr: &'tcx Expr) {
1381
1381
this. visit_expr ( input) ;
1382
1382
}
1383
1383
1384
- // Output operands must be lvalues
1384
+ // Output operands must be places
1385
1385
for ( o, output) in ia. outputs . iter ( ) . zip ( outputs) {
1386
1386
if !o. is_indirect {
1387
- this. check_lvalue ( output) ;
1387
+ this. check_place ( output) ;
1388
1388
}
1389
1389
this. visit_expr ( output) ;
1390
1390
}
@@ -1409,7 +1409,7 @@ fn check_expr<'a, 'tcx>(this: &mut Liveness<'a, 'tcx>, expr: &'tcx Expr) {
1409
1409
}
1410
1410
1411
1411
impl < ' a , ' tcx > Liveness < ' a , ' tcx > {
1412
- fn check_lvalue ( & mut self , expr : & ' tcx Expr ) {
1412
+ fn check_place ( & mut self , expr : & ' tcx Expr ) {
1413
1413
match expr. node {
1414
1414
hir:: ExprPath ( hir:: QPath :: Resolved ( _, ref path) ) => {
1415
1415
if let Def :: Local ( nid) = path. def {
@@ -1423,7 +1423,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
1423
1423
}
1424
1424
}
1425
1425
_ => {
1426
- // For other kinds of lvalues , no checks are required,
1426
+ // For other kinds of places , no checks are required,
1427
1427
// and any embedded expressions are actually rvalues
1428
1428
intravisit:: walk_expr ( self , expr) ;
1429
1429
}
0 commit comments