fix tests & rustdoc

This commit is contained in:
Ariel Ben-Yehuda 2015-11-25 01:23:22 +02:00 committed by Ariel Ben-Yehuda
parent 0a8bb4c509
commit 52dd2b4c35
12 changed files with 25 additions and 22 deletions

View File

@ -158,7 +158,7 @@ can be combined to control the exact logging you want to see. For example, when
debugging linking in the compiler, you might set the following:
```sh
RUST_LOG=rustc::metadata::creader,rustc::util::filesearch,rustc::back::rpath
RUST_LOG=rustc_metadata::creader,rustc::util::filesearch,rustc::back::rpath
```
For a full description, see [the logging crate][1].

View File

@ -107,7 +107,7 @@ fn test_env<F>(source_string: &str,
let diagnostic_handler = diagnostic::Handler::with_emitter(true, emitter);
let span_diagnostic_handler = diagnostic::SpanHandler::new(diagnostic_handler, codemap);
let cstore = ::rustc::metadata::cstore::CStore::new(token::get_ident_interner());
let cstore = ::rustc_metadata::cstore::CStore::new(token::get_ident_interner());
let sess = session::build_session_(options, None, span_diagnostic_handler,
Box::new(cstore));
rustc_lint::register_builtins(&mut sess.lint_store.borrow_mut(), Some(&sess));

View File

@ -16,7 +16,7 @@ use syntax::ast;
use syntax::attr::AttrMetaMethods;
use rustc_front::hir;
use rustc::metadata::util::{self as mdutil, CrateStore};
use rustc::middle::cstore::{self, CrateStore};
use rustc::middle::def;
use rustc::middle::def_id::DefId;
use rustc::middle::ty;
@ -253,11 +253,11 @@ pub fn build_impls(cx: &DocContext, tcx: &ty::ctxt,
}
fn populate_impls(cx: &DocContext, tcx: &ty::ctxt,
def: mdutil::DefLike,
def: cstore::DefLike,
impls: &mut Vec<clean::Item>) {
match def {
mdutil::DlImpl(did) => build_impl(cx, tcx, did, impls),
mdutil::DlDef(def::DefMod(did)) => {
cstore::DlImpl(did) => build_impl(cx, tcx, did, impls),
cstore::DlDef(def::DefMod(did)) => {
for item in tcx.sess.cstore.item_children(did) {
populate_impls(cx, tcx, item.def, impls)
}
@ -450,20 +450,20 @@ fn build_module(cx: &DocContext, tcx: &ty::ctxt,
let mut visited = HashSet::new();
for item in tcx.sess.cstore.item_children(did) {
match item.def {
mdutil::DlDef(def::DefForeignMod(did)) => {
cstore::DlDef(def::DefForeignMod(did)) => {
fill_in(cx, tcx, did, items);
}
mdutil::DlDef(def) if item.vis == hir::Public => {
cstore::DlDef(def) if item.vis == hir::Public => {
if !visited.insert(def) { return }
match try_inline_def(cx, tcx, def) {
Some(i) => items.extend(i),
None => {}
}
}
mdutil::DlDef(..) => {}
cstore::DlDef(..) => {}
// All impls were inlined above
mdutil::DlImpl(..) => {}
mdutil::DlField => panic!("unimplemented field"),
cstore::DlImpl(..) => {}
cstore::DlField => panic!("unimplemented field"),
}
}
}

View File

@ -35,7 +35,7 @@ use syntax::parse::token::{self, InternedString, special_idents};
use syntax::ptr::P;
use rustc_trans::back::link;
use rustc::metadata::util::{self as mdutil, CrateStore};
use rustc::middle::cstore::{self, CrateStore};
use rustc::middle::def;
use rustc::middle::def_id::{DefId, DefIndex};
use rustc::middle::subst::{self, ParamSpace, VecPerParamSpace};
@ -225,7 +225,7 @@ impl Clean<ExternalCrate> for CrateNum {
cx.tcx_opt().map(|tcx| {
for item in tcx.sess.cstore.crate_top_level_items(self.0) {
let did = match item.def {
mdutil::DlDef(def::DefMod(did)) => did,
cstore::DlDef(def::DefMod(did)) => did,
_ => continue
};
let attrs = inline::load_attrs(cx, tcx, did);

View File

@ -12,7 +12,6 @@ pub use self::MaybeTyped::*;
use rustc_lint;
use rustc_driver::{driver, target_features};
use rustc::session::{self, config};
use rustc::metadata::cstore::CStore;
use rustc::middle::def_id::DefId;
use rustc::middle::privacy::AccessLevels;
use rustc::middle::ty;
@ -21,6 +20,7 @@ use rustc::lint;
use rustc_trans::back::link;
use rustc_resolve as resolve;
use rustc_front::lowering::{lower_crate, LoweringContext};
use rustc_metadata::cstore::CStore;
use syntax::{ast, codemap, diagnostic};
use syntax::feature_gate::UnstableFeatures;

View File

@ -18,7 +18,7 @@
use std::fmt;
use std::iter::repeat;
use rustc::metadata::cstore::LOCAL_CRATE;
use rustc::middle::cstore::LOCAL_CRATE;
use rustc::middle::def_id::{CRATE_DEF_INDEX, DefId};
use syntax::abi::Abi;
use rustc_front::hir;

View File

@ -54,7 +54,7 @@ use externalfiles::ExternalHtml;
use serialize::json::{self, ToJson};
use syntax::{abi, ast};
use rustc::metadata::cstore::LOCAL_CRATE;
use rustc::middle::cstore::LOCAL_CRATE;
use rustc::middle::def_id::{CRATE_DEF_INDEX, DefId};
use rustc::middle::privacy::AccessLevels;
use rustc::middle::stability;

View File

@ -43,6 +43,7 @@ extern crate rustc_resolve;
extern crate rustc_lint;
extern crate rustc_back;
extern crate rustc_front;
extern crate rustc_metadata;
extern crate serialize;
extern crate syntax;
extern crate test as testing;

View File

@ -26,13 +26,13 @@ use std::sync::{Arc, Mutex};
use testing;
use rustc_lint;
use rustc::front::map as hir_map;
use rustc::metadata::cstore::CStore;
use rustc::session::{self, config};
use rustc::session::config::{get_unstable_features_setting, OutputType};
use rustc::session::search_paths::{SearchPaths, PathKind};
use rustc_front::lowering::{lower_crate, LoweringContext};
use rustc_back::tempdir::TempDir;
use rustc_driver::{driver, Compilation};
use rustc_metadata::cstore::CStore;
use syntax::codemap::CodeMap;
use syntax::diagnostic;
use syntax::parse::token;

View File

@ -16,6 +16,7 @@ extern crate rustc;
extern crate rustc_driver;
extern crate rustc_front;
extern crate rustc_lint;
extern crate rustc_metadata;
extern crate rustc_resolve;
extern crate syntax;
@ -27,14 +28,14 @@ use std::thread::Builder;
use rustc::front::map as ast_map;
use rustc::llvm;
use rustc::metadata::cstore::{CStore, RequireDynamic};
use rustc::metadata::util::CrateStore;
use rustc::middle::cstore::{CrateStore, LinkagePreference};
use rustc::middle::ty;
use rustc::session::config::{self, basic_options, build_configuration, Input, Options};
use rustc::session::build_session;
use rustc_driver::driver;
use rustc_front::lowering::{lower_crate, LoweringContext};
use rustc_resolve::MakeGlobMap;
use rustc_metadata::cstore::CStore;
use libc::c_void;
use syntax::diagnostics::registry::Registry;
@ -240,7 +241,7 @@ fn compile_program(input: &str, sysroot: PathBuf)
let trans = driver::phase_4_translate_to_llvm(tcx, mir_map, analysis);
let crates = tcx.sess.cstore.used_crates(RequireDynamic);
let crates = tcx.sess.cstore.used_crates(LinkagePreference::RequireDynamic);
// Collect crates used in the session.
// Reverse order finds dependencies first.

View File

@ -13,12 +13,13 @@
extern crate rustc;
extern crate rustc_driver;
extern crate rustc_lint;
extern crate rustc_metadata;
extern crate syntax;
use rustc::metadata::cstore::CStore;
use rustc::session::{build_session, Session};
use rustc::session::config::{basic_options, build_configuration, Input, OutputType};
use rustc_driver::driver::{compile_input, CompileController};
use rustc_metadata::cstore::CStore;
use syntax::diagnostics::registry::Registry;
use syntax::parse::token;

View File

@ -10,5 +10,5 @@ all:
mkdir -p $(TMPDIR)/outdir
$(RUSTC) foo.rs -o $(TMPDIR)/outdir/$(NAME)
ln -nsf outdir/$(NAME) $(TMPDIR)
RUST_LOG=rustc::metadata::loader $(RUSTC) bar.rs
RUST_LOG=rustc_metadata::loader $(RUSTC) bar.rs
endif