Remove the dep-info-no-analysis
test and fix other fallout.
This commit is contained in:
parent
c52968af8c
commit
3fc0407fb3
@ -26,7 +26,6 @@ use rustc::traits::ProjectionMode;
|
||||
use rustc::ty::{self, Ty, TyCtxt, TypeFoldable};
|
||||
use rustc::infer::{self, InferOk, InferResult, TypeOrigin};
|
||||
use rustc_metadata::cstore::CStore;
|
||||
use rustc_metadata::creader::read_local_crates;
|
||||
use rustc::hir::map as hir_map;
|
||||
use rustc::session::{self, config};
|
||||
use std::rc::Rc;
|
||||
@ -116,19 +115,11 @@ fn test_env<F>(source_string: &str,
|
||||
input: source_string.to_string(),
|
||||
};
|
||||
let krate = driver::phase_1_parse_input(&sess, krate_config, &input).unwrap();
|
||||
let krate = driver::phase_2_configure_and_expand(&sess, &cstore, krate, "test", None)
|
||||
.expect("phase 2 aborted");
|
||||
|
||||
let krate = driver::assign_node_ids(&sess, krate);
|
||||
let mut defs = hir_map::collect_definitions(&krate);
|
||||
read_local_crates(&sess, &cstore, &defs, &krate, "test_crate", &dep_graph);
|
||||
let driver::ExpansionResult { defs, resolutions, mut hir_forest, .. } =
|
||||
driver::phase_2_configure_and_expand(&sess, &cstore, krate, "test", None, MakeGlobMap::No)
|
||||
.expect("phase 2 aborted");
|
||||
let _ignore = dep_graph.in_ignore();
|
||||
|
||||
let (_, resolutions, mut hir_forest) = {
|
||||
driver::lower_and_resolve(&sess, "test-crate", &mut defs, &krate,
|
||||
&sess.dep_graph, MakeGlobMap::No)
|
||||
};
|
||||
|
||||
let arenas = ty::CtxtArenas::new();
|
||||
let ast_map = hir_map::map_crate(&mut hir_forest, defs);
|
||||
|
||||
|
@ -21,7 +21,6 @@ use rustc::lint;
|
||||
use rustc_trans::back::link;
|
||||
use rustc_resolve as resolve;
|
||||
use rustc_metadata::cstore::CStore;
|
||||
use rustc_metadata::creader::read_local_crates;
|
||||
|
||||
use syntax::{ast, codemap, errors};
|
||||
use syntax::errors::emitter::ColorConfig;
|
||||
@ -146,21 +145,12 @@ pub fn run_core(search_paths: SearchPaths,
|
||||
|
||||
let krate = panictry!(driver::phase_1_parse_input(&sess, cfg, &input));
|
||||
|
||||
let name = link::find_crate_name(Some(&sess), &krate.attrs,
|
||||
&input);
|
||||
let name = link::find_crate_name(Some(&sess), &krate.attrs, &input);
|
||||
|
||||
let krate = driver::phase_2_configure_and_expand(&sess, &cstore, krate, &name, None)
|
||||
.expect("phase_2_configure_and_expand aborted in rustdoc!");
|
||||
|
||||
let krate = driver::assign_node_ids(&sess, krate);
|
||||
|
||||
let mut defs = hir_map::collect_definitions(&krate);
|
||||
read_local_crates(&sess, &cstore, &defs, &krate, &name, &dep_graph);
|
||||
|
||||
// Lower ast -> hir and resolve.
|
||||
let (analysis, resolutions, mut hir_forest) = {
|
||||
driver::lower_and_resolve(&sess, &name, &mut defs, &krate,
|
||||
&sess.dep_graph, resolve::MakeGlobMap::No)
|
||||
let driver::ExpansionResult { defs, analysis, resolutions, mut hir_forest, .. } = {
|
||||
let make_glob_map = resolve::MakeGlobMap::No;
|
||||
driver::phase_2_configure_and_expand(&sess, &cstore, krate, &name, None, make_glob_map)
|
||||
.expect("phase_2_configure_and_expand aborted in rustdoc!")
|
||||
};
|
||||
|
||||
let arenas = ty::CtxtArenas::new();
|
||||
|
@ -28,11 +28,12 @@ use rustc::hir::map as hir_map;
|
||||
use rustc::session::{self, config};
|
||||
use rustc::session::config::{get_unstable_features_setting, OutputType};
|
||||
use rustc::session::search_paths::{SearchPaths, PathKind};
|
||||
use rustc::hir::lowering::{lower_crate, DummyResolver};
|
||||
use rustc_back::dynamic_lib::DynamicLibrary;
|
||||
use rustc_back::tempdir::TempDir;
|
||||
use rustc_driver::{driver, Compilation};
|
||||
use rustc_driver::driver::phase_2_configure_and_expand;
|
||||
use rustc_metadata::cstore::CStore;
|
||||
use rustc_resolve::MakeGlobMap;
|
||||
use syntax::codemap::CodeMap;
|
||||
use syntax::errors;
|
||||
use syntax::errors::emitter::ColorConfig;
|
||||
@ -93,21 +94,16 @@ pub fn run(input: &str,
|
||||
let mut cfg = config::build_configuration(&sess);
|
||||
cfg.extend(config::parse_cfgspecs(cfgs.clone()));
|
||||
let krate = panictry!(driver::phase_1_parse_input(&sess, cfg, &input));
|
||||
let krate = driver::phase_2_configure_and_expand(&sess, &cstore, krate,
|
||||
"rustdoc-test", None)
|
||||
.expect("phase_2_configure_and_expand aborted in rustdoc!");
|
||||
let krate = driver::assign_node_ids(&sess, krate);
|
||||
let driver::ExpansionResult { defs, mut hir_forest, .. } = {
|
||||
let make_glob_map = MakeGlobMap::No;
|
||||
phase_2_configure_and_expand(&sess, &cstore, krate, "rustdoc-test", None, make_glob_map)
|
||||
.expect("phase_2_configure_and_expand aborted in rustdoc!")
|
||||
};
|
||||
|
||||
let dep_graph = DepGraph::new(false);
|
||||
let defs = hir_map::collect_definitions(&krate);
|
||||
|
||||
let mut dummy_resolver = DummyResolver;
|
||||
let krate = lower_crate(&sess, &krate, &sess, &mut dummy_resolver);
|
||||
|
||||
let opts = scrape_test_config(&krate);
|
||||
|
||||
let opts = scrape_test_config(hir_forest.krate());
|
||||
let _ignore = dep_graph.in_ignore();
|
||||
let mut forest = hir_map::Forest::new(krate, &dep_graph);
|
||||
let map = hir_map::map_crate(&mut forest, defs);
|
||||
let map = hir_map::map_crate(&mut hir_forest, defs);
|
||||
|
||||
let ctx = core::DocContext {
|
||||
map: &map,
|
||||
|
@ -1,6 +0,0 @@
|
||||
-include ../tools.mk
|
||||
|
||||
all:
|
||||
$(RUSTC) -o $(TMPDIR)/input.dd -Z no-analysis --emit dep-info input.rs
|
||||
sed -i'.bak' 's/^.*input.dd/input.dd/g' $(TMPDIR)/input.dd
|
||||
diff -u $(TMPDIR)/input.dd input.dd
|
@ -1,3 +0,0 @@
|
||||
input.dd: input.rs
|
||||
|
||||
input.rs:
|
@ -1,14 +0,0 @@
|
||||
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// Tests that dep info can be emitted without resolving external crates.
|
||||
extern crate not_there;
|
||||
|
||||
fn main() {}
|
@ -238,15 +238,9 @@ fn compile_program(input: &str, sysroot: PathBuf)
|
||||
|
||||
let krate = panictry!(driver::phase_1_parse_input(&sess, cfg, &input));
|
||||
|
||||
let krate = driver::phase_2_configure_and_expand(&sess, &cstore, krate, &id, None)
|
||||
.expect("phase_2 returned `None`");
|
||||
|
||||
let krate = driver::assign_node_ids(&sess, krate);
|
||||
let mut defs = ast_map::collect_definitions(&krate);
|
||||
read_local_crates(&sess, &cstore, &defs, &krate, &id, &dep_graph);
|
||||
let (analysis, resolutions, mut hir_forest) = {
|
||||
driver::lower_and_resolve(&sess, &id, &mut defs, &krate,
|
||||
&sess.dep_graph, MakeGlobMap::No)
|
||||
let driver::ExpansionResult { defs, analysis, resolutions, mut hir_forest, .. } = {
|
||||
driver::phase_2_configure_and_expand(&sess, &cstore, krate, &id, None, MakeGlobMap::No)
|
||||
.expect("phase_2 returned `None`")
|
||||
};
|
||||
|
||||
let arenas = ty::CtxtArenas::new();
|
||||
|
Loading…
x
Reference in New Issue
Block a user