@@ -447,7 +447,7 @@ fn visit_arm(ir: &mut IrMaps, arm: &ast::Arm) {
447
447
fn visit_expr ( ir : & mut IrMaps , expr : & Expr ) {
448
448
match expr. node {
449
449
// live nodes required for uses or definitions of variables:
450
- ast:: ExprPath ( _) => {
450
+ ast:: ExprPath ( _) | ast :: ExprQPath ( _ ) => {
451
451
let def = ir. tcx . def_map . borrow ( ) [ expr. id ] . clone ( ) ;
452
452
debug ! ( "expr {}: path that leads to {:?}" , expr. id, def) ;
453
453
if let DefLocal ( ..) = def {
@@ -960,7 +960,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
960
960
match expr. node {
961
961
// Interesting cases with control flow or which gen/kill
962
962
963
- ast:: ExprPath ( _) => {
963
+ ast:: ExprPath ( _) | ast :: ExprQPath ( _ ) => {
964
964
self . access_path ( expr, succ, ACC_READ | ACC_USE )
965
965
}
966
966
@@ -1289,7 +1289,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
1289
1289
// just ignore such cases and treat them as reads.
1290
1290
1291
1291
match expr. node {
1292
- ast:: ExprPath ( _) => succ,
1292
+ ast:: ExprPath ( _) | ast :: ExprQPath ( _ ) => succ,
1293
1293
ast:: ExprField ( ref e, _) => self . propagate_through_expr ( & * * e, succ) ,
1294
1294
ast:: ExprTupField ( ref e, _) => self . propagate_through_expr ( & * * e, succ) ,
1295
1295
_ => self . propagate_through_expr ( expr, succ)
@@ -1300,7 +1300,9 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
1300
1300
fn write_lvalue ( & mut self , expr : & Expr , succ : LiveNode , acc : uint )
1301
1301
-> LiveNode {
1302
1302
match expr. node {
1303
- ast:: ExprPath ( _) => self . access_path ( expr, succ, acc) ,
1303
+ ast:: ExprPath ( _) | ast:: ExprQPath ( _) => {
1304
+ self . access_path ( expr, succ, acc)
1305
+ }
1304
1306
1305
1307
// We do not track other lvalues, so just propagate through
1306
1308
// to their subcomponents. Also, it may happen that
@@ -1492,7 +1494,7 @@ fn check_expr(this: &mut Liveness, expr: &Expr) {
1492
1494
ast:: ExprBlock ( ..) | ast:: ExprMac ( ..) | ast:: ExprAddrOf ( ..) |
1493
1495
ast:: ExprStruct ( ..) | ast:: ExprRepeat ( ..) | ast:: ExprParen ( ..) |
1494
1496
ast:: ExprClosure ( ..) | ast:: ExprPath ( ..) | ast:: ExprBox ( ..) |
1495
- ast:: ExprRange ( ..) => {
1497
+ ast:: ExprRange ( ..) | ast :: ExprQPath ( .. ) => {
1496
1498
visit:: walk_expr ( this, expr) ;
1497
1499
}
1498
1500
ast:: ExprIfLet ( ..) => {
@@ -1583,7 +1585,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
1583
1585
1584
1586
fn check_lvalue ( & mut self , expr : & Expr ) {
1585
1587
match expr. node {
1586
- ast:: ExprPath ( _) => {
1588
+ ast:: ExprPath ( _) | ast :: ExprQPath ( _ ) => {
1587
1589
if let DefLocal ( nid) = self . ir . tcx . def_map . borrow ( ) [ expr. id ] . clone ( ) {
1588
1590
// Assignment to an immutable variable or argument: only legal
1589
1591
// if there is no later assignment. If this local is actually
0 commit comments