Add an intital HIR and lowering step
This commit is contained in:
parent
cfd76b364c
commit
facdf2ebb1
160 changed files with 13917 additions and 4451 deletions
|
|
@ -14,10 +14,12 @@ use rustc_driver::{driver, target_features};
|
|||
use rustc::session::{self, config};
|
||||
use rustc::middle::def_id::DefId;
|
||||
use rustc::middle::{privacy, ty};
|
||||
use rustc::ast_map;
|
||||
use rustc::front::map as hir_map;
|
||||
use rustc::lint;
|
||||
use rustc_trans::back::link;
|
||||
use rustc_resolve as resolve;
|
||||
use rustc_front::lowering::lower_crate;
|
||||
use rustc_front::hir;
|
||||
|
||||
use syntax::{ast, codemap, diagnostic};
|
||||
use syntax::feature_gate::UnstableFeatures;
|
||||
|
|
@ -42,7 +44,7 @@ pub type ExternalPaths = RefCell<Option<HashMap<DefId,
|
|||
(Vec<String>, clean::TypeKind)>>>;
|
||||
|
||||
pub struct DocContext<'a, 'tcx: 'a> {
|
||||
pub krate: &'tcx ast::Crate,
|
||||
pub krate: &'tcx hir::Crate,
|
||||
pub maybe_typed: MaybeTyped<'a, 'tcx>,
|
||||
pub input: Input,
|
||||
pub external_paths: ExternalPaths,
|
||||
|
|
@ -131,12 +133,15 @@ pub fn run_core(search_paths: SearchPaths, cfgs: Vec<String>, externs: Externs,
|
|||
let krate = driver::phase_2_configure_and_expand(&sess, krate, &name, None)
|
||||
.expect("phase_2_configure_and_expand aborted in rustdoc!");
|
||||
|
||||
let mut forest = ast_map::Forest::new(krate);
|
||||
let krate = driver::assign_node_ids(&sess, krate);
|
||||
// Lower ast -> hir.
|
||||
let mut hir_forest = hir_map::Forest::new(lower_crate(&krate));
|
||||
let arenas = ty::CtxtArenas::new();
|
||||
let ast_map = driver::assign_node_ids_and_map(&sess, &mut forest);
|
||||
let hir_map = driver::make_map(&sess, &mut hir_forest);
|
||||
|
||||
driver::phase_3_run_analysis_passes(sess,
|
||||
ast_map,
|
||||
hir_map,
|
||||
&krate,
|
||||
&arenas,
|
||||
name,
|
||||
resolve::MakeGlobMap::No,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue