mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-28 20:16:58 +03:00
Auto merge of #39286 - nrc:save-path, r=eddyb
save-analysis: polishing paths a couple of minor changes that get us better coverage of different paths. r? @eddyb
This commit is contained in:
@@ -1359,6 +1359,7 @@ fn visit_ty(&mut self, t: &'l ast::Ty) {
|
||||
}
|
||||
|
||||
self.write_sub_paths_truncated(path);
|
||||
visit::walk_path(self, path);
|
||||
}
|
||||
ast::TyKind::Array(ref element, ref length) => {
|
||||
self.visit_ty(element);
|
||||
@@ -1369,6 +1370,7 @@ fn visit_ty(&mut self, t: &'l ast::Ty) {
|
||||
}
|
||||
|
||||
fn visit_expr(&mut self, ex: &'l ast::Expr) {
|
||||
debug!("visit_expr {:?}", ex.node);
|
||||
self.process_macro_use(ex.span, ex.id);
|
||||
match ex.node {
|
||||
ast::ExprKind::Call(ref _f, ref _args) => {
|
||||
@@ -1462,6 +1464,7 @@ fn visit_expr(&mut self, ex: &'l ast::Expr) {
|
||||
ast::ExprKind::WhileLet(ref pattern, ref subexpression, ref block, _) => {
|
||||
let value = self.span.snippet(subexpression.span);
|
||||
self.process_var_decl(pattern, value);
|
||||
debug!("for loop, walk sub-expr: {:?}", subexpression.node);
|
||||
visit::walk_expr(self, subexpression);
|
||||
visit::walk_block(self, block);
|
||||
}
|
||||
@@ -1556,6 +1559,10 @@ fn visit_arm(&mut self, arm: &'l ast::Arm) {
|
||||
self.visit_expr(&arm.body);
|
||||
}
|
||||
|
||||
fn visit_path(&mut self, p: &'l ast::Path, id: NodeId) {
|
||||
self.process_path(id, p, None);
|
||||
}
|
||||
|
||||
fn visit_stmt(&mut self, s: &'l ast::Stmt) {
|
||||
self.process_macro_use(s.span, s.id);
|
||||
visit::walk_stmt(self, s)
|
||||
|
||||
Reference in New Issue
Block a user