Auto merge of #43730 - nrc:driver-shim, r=eddyb
Make the driver API a little more useful for a tools shim Example use case: https://github.com/nrc/rls-rustc
This commit is contained in:
commit
57e720d2cd
5 changed files with 45 additions and 26 deletions
|
|
@ -155,7 +155,9 @@ pub fn run_core(search_paths: SearchPaths,
|
|||
target_features::add_configuration(&mut cfg, &sess);
|
||||
sess.parse_sess.config = cfg;
|
||||
|
||||
let krate = panictry!(driver::phase_1_parse_input(&sess, &input));
|
||||
let krate = panictry!(driver::phase_1_parse_input(&driver::CompileController::basic(),
|
||||
&sess,
|
||||
&input));
|
||||
|
||||
let name = link::find_crate_name(Some(&sess), &krate.attrs, &input);
|
||||
|
||||
|
|
|
|||
|
|
@ -91,7 +91,9 @@ pub fn run(input: &str,
|
|||
sess.parse_sess.config =
|
||||
config::build_configuration(&sess, config::parse_cfgspecs(cfgs.clone()));
|
||||
|
||||
let krate = panictry!(driver::phase_1_parse_input(&sess, &input));
|
||||
let krate = panictry!(driver::phase_1_parse_input(&driver::CompileController::basic(),
|
||||
&sess,
|
||||
&input));
|
||||
let driver::ExpansionResult { defs, mut hir_forest, .. } = {
|
||||
phase_2_configure_and_expand(
|
||||
&sess, &cstore, krate, None, "rustdoc-test", None, MakeGlobMap::No, |_| Ok(())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue