Split nested_visit_mode function off from nested_visit_map
... and make the latter mandatory to implement.
This commit is contained in:
parent
725cffb1d5
commit
f0ce5bb66b
35 changed files with 160 additions and 110 deletions
|
|
@ -11,7 +11,7 @@
|
|||
use rustc::hir;
|
||||
use rustc::hir::map as ast_map;
|
||||
|
||||
use rustc::hir::intravisit::{Visitor, IdRangeComputingVisitor, IdRange, NestedVisitMode};
|
||||
use rustc::hir::intravisit::{Visitor, IdRangeComputingVisitor, IdRange};
|
||||
|
||||
use cstore::CrateMetadata;
|
||||
use encoder::EncodeContext;
|
||||
|
|
@ -75,8 +75,8 @@ struct SideTableEncodingIdVisitor<'a, 'b: 'a, 'tcx: 'b> {
|
|||
}
|
||||
|
||||
impl<'a, 'b, 'tcx> Visitor<'tcx> for SideTableEncodingIdVisitor<'a, 'b, 'tcx> {
|
||||
fn nested_visit_map(&mut self) -> Option<(&hir::map::Map<'tcx>, NestedVisitMode)> {
|
||||
Some((&self.ecx.tcx.map, NestedVisitMode::OnlyBodies))
|
||||
fn nested_visit_map(&mut self) -> Option<&hir::map::Map<'tcx>> {
|
||||
Some(&self.ecx.tcx.map)
|
||||
}
|
||||
|
||||
fn visit_id(&mut self, id: ast::NodeId) {
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ use syntax_pos;
|
|||
|
||||
use rustc::hir::{self, PatKind};
|
||||
use rustc::hir::itemlikevisit::ItemLikeVisitor;
|
||||
use rustc::hir::intravisit::{Visitor, NestedVisitMode};
|
||||
use rustc::hir::intravisit::{Visitor};
|
||||
use rustc::hir::intravisit;
|
||||
|
||||
use super::index_builder::{FromId, IndexBuilder, Untracked};
|
||||
|
|
@ -983,8 +983,8 @@ struct EncodeVisitor<'a, 'b: 'a, 'tcx: 'b> {
|
|||
}
|
||||
|
||||
impl<'a, 'b, 'tcx> Visitor<'tcx> for EncodeVisitor<'a, 'b, 'tcx> {
|
||||
fn nested_visit_map(&mut self) -> Option<(&hir::map::Map<'tcx>, NestedVisitMode)> {
|
||||
Some((&self.index.tcx.map, NestedVisitMode::OnlyBodies))
|
||||
fn nested_visit_map(&mut self) -> Option<&hir::map::Map<'tcx>> {
|
||||
Some(&self.index.tcx.map)
|
||||
}
|
||||
fn visit_expr(&mut self, ex: &'tcx hir::Expr) {
|
||||
intravisit::walk_expr(self, ex);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue