Remove rustc_hir reexports in rustc::hir.

This commit is contained in:
Mazdak Farrokhzad 2020-01-05 02:37:57 +01:00
parent 1c091bba51
commit ebfd8673a7
340 changed files with 866 additions and 826 deletions

View file

@ -5,8 +5,7 @@ use crate::util;
use log::{info, log_enabled, warn};
use rustc::arena::Arena;
use rustc::dep_graph::DepGraph;
use rustc::hir;
use rustc::hir::def_id::{CrateNum, LOCAL_CRATE};
use rustc::hir::map;
use rustc::lint;
use rustc::middle;
use rustc::middle::cstore::{CrateStore, MetadataLoader, MetadataLoaderDyn};
@ -26,6 +25,7 @@ use rustc_data_structures::sync::{par_iter, Lrc, Once, ParallelIterator, WorkerL
use rustc_data_structures::{box_region_allow_access, declare_box_region_type, parallel};
use rustc_errors::PResult;
use rustc_expand::base::ExtCtxt;
use rustc_hir::def_id::{CrateNum, LOCAL_CRATE};
use rustc_incremental;
use rustc_mir as mir;
use rustc_parse::{parse_crate_from_file, parse_crate_from_source_str};
@ -433,7 +433,7 @@ pub fn lower_to_hir<'res, 'tcx>(
dep_graph: &'res DepGraph,
krate: &'res ast::Crate,
arena: &'tcx Arena<'tcx>,
) -> Result<hir::map::Forest<'tcx>> {
) -> Result<map::Forest<'tcx>> {
// Lower AST to HIR.
let hir_forest = sess.time("lowering AST -> HIR", || {
let hir_crate = rustc_ast_lowering::lower_crate(
@ -449,7 +449,7 @@ pub fn lower_to_hir<'res, 'tcx>(
hir_stats::print_hir_stats(&hir_crate);
}
hir::map::Forest::new(hir_crate, &dep_graph)
map::Forest::new(hir_crate, &dep_graph)
});
sess.time("early lint checks", || {
@ -676,7 +676,7 @@ pub fn default_provide(providers: &mut ty::query::Providers<'_>) {
providers.analysis = analysis;
proc_macro_decls::provide(providers);
plugin::build::provide(providers);
hir::provide(providers);
rustc::hir::provide(providers);
mir::provide(providers);
rustc_privacy::provide(providers);
typeck::provide(providers);
@ -714,7 +714,7 @@ impl<'tcx> QueryContext<'tcx> {
pub fn create_global_ctxt<'tcx>(
compiler: &'tcx Compiler,
lint_store: Lrc<lint::LintStore>,
hir_forest: &'tcx hir::map::Forest<'tcx>,
hir_forest: &'tcx map::Forest<'tcx>,
mut resolver_outputs: ResolverOutputs,
outputs: OutputFilenames,
crate_name: &str,
@ -727,7 +727,7 @@ pub fn create_global_ctxt<'tcx>(
// Construct the HIR map.
let hir_map = sess.time("indexing HIR", || {
hir::map::map_crate(sess, &*resolver_outputs.cstore, &hir_forest, defs)
map::map_crate(sess, &*resolver_outputs.cstore, &hir_forest, defs)
});
let query_result_on_disk_cache =

View file

@ -1,8 +1,8 @@
use rustc::hir;
use rustc::hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
use rustc::hir::itemlikevisit::ItemLikeVisitor;
use rustc::ty::query::Providers;
use rustc::ty::TyCtxt;
use rustc_hir as hir;
use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
use rustc_hir::itemlikevisit::ItemLikeVisitor;
use rustc_span::symbol::sym;
use syntax::attr;

View file

@ -3,8 +3,7 @@ use crate::passes::{self, BoxedResolver, QueryContext};
use rustc::arena::Arena;
use rustc::dep_graph::DepGraph;
use rustc::hir;
use rustc::hir::def_id::LOCAL_CRATE;
use rustc::hir::map;
use rustc::lint;
use rustc::lint::LintStore;
use rustc::session::config::{OutputFilenames, OutputType};
@ -14,6 +13,7 @@ use rustc::ty::{AllArenas, GlobalCtxt, ResolverOutputs};
use rustc::util::common::ErrorReported;
use rustc_codegen_utils::codegen_backend::CodegenBackend;
use rustc_data_structures::sync::{Lrc, Once, WorkerLocal};
use rustc_hir::def_id::LOCAL_CRATE;
use rustc_incremental::DepGraphFuture;
use std::any::Any;
use std::cell::{Ref, RefCell, RefMut};
@ -76,7 +76,7 @@ pub struct Queries<'tcx> {
register_plugins: Query<(ast::Crate, Lrc<LintStore>)>,
expansion: Query<(ast::Crate, Steal<Rc<RefCell<BoxedResolver>>>, Lrc<LintStore>)>,
dep_graph: Query<DepGraph>,
lower_to_hir: Query<(&'tcx hir::map::Forest<'tcx>, Steal<ResolverOutputs>)>,
lower_to_hir: Query<(&'tcx map::Forest<'tcx>, Steal<ResolverOutputs>)>,
prepare_outputs: Query<OutputFilenames>,
global_ctxt: Query<QueryContext<'tcx>>,
ongoing_codegen: Query<Box<dyn Any>>,
@ -211,7 +211,7 @@ impl<'tcx> Queries<'tcx> {
pub fn lower_to_hir(
&'tcx self,
) -> Result<&Query<(&'tcx hir::map::Forest<'tcx>, Steal<ResolverOutputs>)>> {
) -> Result<&Query<(&'tcx map::Forest<'tcx>, Steal<ResolverOutputs>)>> {
self.lower_to_hir.compute(|| {
let expansion_result = self.expansion()?;
let peeked = expansion_result.peek();