about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2018-03-09 18:58:44 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2018-03-17 22:12:21 +0300
commitb057c554ab9c7615ebdb3c920010a164ec5bf3ed (patch)
tree3fcc7c2945653152d55af9c48a498b9bb5384c94 /src/libsyntax/parse/parser.rs
parentc6c6cf9515b330551b04f36025bc72e1288a96d9 (diff)
downloadrust-b057c554ab9c7615ebdb3c920010a164ec5bf3ed.tar.gz
rust-b057c554ab9c7615ebdb3c920010a164ec5bf3ed.zip
AST: Make renames in imports closer to the source
Fix `unused_import_braces` lint false positive on `use prefix::{self as rename}`
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
-rw-r--r--src/libsyntax/parse/parser.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index d1234d25764..7a432930490 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -7033,9 +7033,7 @@ impl<'a> Parser<'a> {
                 }
             } else {
                 // `use path::foo;` or `use path::foo as bar;`
-                let rename = self.parse_rename()?.
-                                  unwrap_or(prefix.segments.last().unwrap().identifier);
-                UseTreeKind::Simple(rename)
+                UseTreeKind::Simple(self.parse_rename()?)
             }
         };