@@ -19,7 +19,7 @@ use rustc::lint;
19
19
use rustc::util::nodemap::DefIdSet;
20
20
use rustc_trans::back::link;
21
21
use rustc_resolve as resolve;
22
- use rustc_front::lowering::lower_crate;
22
+ use rustc_front::lowering::{ lower_crate, LoweringContext} ;
23
23
24
24
use syntax::{ast, codemap, diagnostic};
25
25
use syntax::feature_gate::UnstableFeatures;
@@ -37,7 +37,7 @@ pub use rustc::session::search_paths::SearchPaths;
37
37
/// Are we generating documentation (`Typed`) or tests (`NotTyped`)?
38
38
pub enum MaybeTyped<'a, 'tcx: 'a> {
39
39
Typed(&'a ty::ctxt<'tcx>),
40
- NotTyped(session::Session)
40
+ NotTyped(&'a session::Session)
41
41
}
42
42
43
43
pub type ExternalPaths = RefCell<Option<HashMap<DefId,
@@ -135,11 +135,13 @@ pub fn run_core(search_paths: SearchPaths, cfgs: Vec<String>, externs: Externs,
135
135
136
136
let krate = driver::assign_node_ids(&sess, krate);
137
137
// Lower ast -> hir.
138
- let mut hir_forest = hir_map::Forest::new(lower_crate(&krate));
138
+ let foo = &42;
139
+ let lcx = LoweringContext::new(foo, &sess, &krate);
140
+ let mut hir_forest = hir_map::Forest::new(lower_crate(&lcx, &krate));
139
141
let arenas = ty::CtxtArenas::new();
140
142
let hir_map = driver::make_map(&sess, &mut hir_forest);
141
143
142
- driver::phase_3_run_analysis_passes(sess,
144
+ driver::phase_3_run_analysis_passes(& sess,
143
145
hir_map,
144
146
&arenas,
145
147
name,
@@ -194,5 +196,5 @@ pub fn run_core(search_paths: SearchPaths, cfgs: Vec<String>, externs: Externs,
194
196
*analysis.inlined.borrow_mut() = map;
195
197
analysis.deref_trait_did = ctxt.deref_trait_did.get();
196
198
(krate, analysis)
197
- }).1
199
+ })
198
200
}
0 commit comments