Module rustc_save_analysis::dump_visitor [−][src]
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Write the output of rustc's analysis to an implementor of Dump.
Dumping the analysis is implemented by walking the AST and getting a bunch of
info out from all over the place. We use Def IDs to identify objects. The
tricky part is getting syntactic (span, source text) and semantic (reference
Def IDs) information for parts of expressions which the compiler has discarded.
E.g., in a path foo::bar::baz
, the compiler only keeps a span for the whole
path and a reference to baz
, but we want spans and references for all three
idents.
SpanUtils is used to manipulate spans. In particular, to extract sub-spans
from spans (e.g., the span for bar
from the above example path).
DumpVisitor walks the AST and processes it, and JsonDumper is used for
recording the output.
Re-exports
use rustc::hir::def::Def as HirDef; |
use rustc::hir::def_id::DefId; |
use rustc::ty; |
use rustc::ty::TyCtxt; |
use rustc_data_structures::fx::FxHashSet; |
use std::path::Path; |
use syntax::ast; |
use syntax::ast::Attribute; |
use syntax::ast::NodeId; |
use syntax::ast::PatKind; |
use syntax::ast::CRATE_NODE_ID; |
use syntax::parse::token; |
use syntax::symbol::keywords; |
use syntax::visit; |
use syntax::visit::Visitor; |
use syntax::print::pprust::bounds_to_string; |
use syntax::print::pprust::generic_params_to_string; |
use syntax::print::pprust::path_to_string; |
use syntax::print::pprust::ty_to_string; |
use syntax::ptr::P; |
use syntax::codemap::Spanned; |
use syntax::codemap::DUMMY_SP; |
use syntax::codemap::respan; |
use syntax_pos::*; |
use escape; |
use generated_code; |
use lower_attributes; |
use PathCollector; |
use SaveContext; |
use json_dumper::Access; |
use json_dumper::DumpOutput; |
use json_dumper::JsonDumper; |
use span_utils::SpanUtils; |
use sig; |
use rls_data::CratePreludeData; |
use rls_data::Def; |
use rls_data::DefKind; |
use rls_data::GlobalCrateId; |
use rls_data::Import; |
use rls_data::ImportKind; |
use rls_data::Ref; |
use rls_data::RefKind; |
use rls_data::Relation; |
use rls_data::RelationKind; |
use rls_data::SpanData; |
Structs
DumpVisitor |
[ Experimental ]
|