From 8b0937293bdb70ab4a5efed02b90a71af2b234f6 Mon Sep 17 00:00:00 2001 From: Eduard Burtescu Date: Tue, 29 Mar 2016 08:50:44 +0300 Subject: [PATCH] rustc: move rustc_front to rustc::hir. --- mk/crates.mk | 31 +++++----- src/librustc/Cargo.toml | 1 - src/librustc/cfg/construct.rs | 4 +- src/librustc/cfg/graphviz.rs | 2 +- src/librustc/cfg/mod.rs | 2 +- src/librustc/dep_graph/mod.rs | 4 +- src/librustc/{front => hir}/check_attr.rs | 0 src/{librustc_front => librustc/hir}/fold.rs | 0 .../hir}/intravisit.rs | 0 .../hir}/lowering.rs | 0 src/librustc/{front => hir}/map/blocks.rs | 8 +-- src/librustc/{front => hir}/map/collector.rs | 5 +- .../{front => hir}/map/definitions.rs | 0 src/librustc/{front => hir}/map/mod.rs | 7 +-- .../hir.rs => librustc/hir/mod.rs} | 33 ++++++----- .../print/pprust.rs => librustc/hir/print.rs} | 8 +-- src/{librustc_back => librustc/hir}/svh.rs | 12 ++-- src/{librustc_front => librustc/hir}/util.rs | 2 +- src/librustc/infer/error_reporting.rs | 6 +- src/librustc/infer/mod.rs | 2 +- src/librustc/lib.rs | 14 +---- src/librustc/lint/context.rs | 6 +- src/librustc/lint/mod.rs | 4 +- src/librustc/middle/astconv_util.rs | 2 +- src/librustc/middle/cstore.rs | 10 ++-- src/librustc/middle/dataflow.rs | 6 +- src/librustc/middle/dead.rs | 6 +- src/librustc/middle/def.rs | 2 +- src/librustc/middle/effect.rs | 6 +- src/librustc/middle/entry.rs | 6 +- src/librustc/middle/expr_use_visitor.rs | 8 +-- src/librustc/middle/intrinsicck.rs | 4 +- src/librustc/middle/lang_items.rs | 6 +- src/librustc/middle/liveness.rs | 12 ++-- src/librustc/middle/mem_categorization.rs | 6 +- src/librustc/middle/pat_util.rs | 4 +- src/librustc/middle/reachable.rs | 8 +-- src/librustc/middle/region.rs | 10 ++-- src/librustc/middle/resolve_lifetime.rs | 8 +-- src/librustc/middle/stability.rs | 8 +-- src/librustc/middle/weak_lang_items.rs | 6 +- src/librustc/mir/repr.rs | 2 +- src/librustc/mir/tcx.rs | 2 +- src/librustc/traits/select.rs | 2 +- src/librustc/ty/adjustment.rs | 2 +- src/librustc/ty/context.rs | 4 +- src/librustc/ty/error.rs | 2 +- src/librustc/ty/item_path.rs | 2 +- src/librustc/ty/mod.rs | 10 ++-- src/librustc/ty/relate.rs | 2 +- src/librustc/ty/structural_impls.rs | 2 +- src/librustc/ty/sty.rs | 2 +- src/librustc/ty/trait_def.rs | 2 +- src/librustc/ty/util.rs | 4 +- src/librustc/util/common.rs | 6 +- src/librustc/util/ppaux.rs | 2 +- src/librustc_back/Cargo.toml | 1 - src/librustc_back/lib.rs | 2 - src/librustc_borrowck/Cargo.toml | 1 - src/librustc_borrowck/borrowck/check_loans.rs | 2 +- .../borrowck/gather_loans/gather_moves.rs | 2 +- .../borrowck/gather_loans/mod.rs | 8 +-- .../borrowck/gather_loans/move_error.rs | 2 +- src/librustc_borrowck/borrowck/mir/mod.rs | 4 +- src/librustc_borrowck/borrowck/mod.rs | 14 ++--- src/librustc_borrowck/borrowck/move_data.rs | 2 +- src/librustc_borrowck/lib.rs | 1 - src/librustc_const_eval/Cargo.toml | 1 - src/librustc_const_eval/check_match.rs | 12 ++-- src/librustc_const_eval/eval.rs | 10 ++-- src/librustc_const_eval/lib.rs | 1 - src/librustc_driver/Cargo.toml | 1 - src/librustc_driver/driver.rs | 9 ++- src/librustc_driver/lib.rs | 1 - src/librustc_driver/pretty.rs | 10 ++-- src/librustc_driver/test.rs | 6 +- src/librustc_front/Cargo.toml | 15 ----- src/librustc_front/lib.rs | 58 ------------------- src/librustc_lint/Cargo.toml | 1 - src/librustc_lint/bad_style.rs | 4 +- src/librustc_lint/builtin.rs | 6 +- src/librustc_lint/lib.rs | 1 - src/librustc_lint/types.rs | 4 +- src/librustc_lint/unused.rs | 4 +- src/librustc_metadata/Cargo.toml | 1 - src/librustc_metadata/astencode.rs | 14 ++--- src/librustc_metadata/creader.rs | 8 +-- src/librustc_metadata/csearch.rs | 8 +-- src/librustc_metadata/cstore.rs | 2 +- src/librustc_metadata/decoder.rs | 6 +- src/librustc_metadata/encoder.rs | 12 ++-- src/librustc_metadata/lib.rs | 1 - src/librustc_metadata/loader.rs | 2 +- src/librustc_metadata/tydecode.rs | 2 +- src/librustc_metadata/tyencode.rs | 2 +- src/librustc_mir/Cargo.toml | 1 - src/librustc_mir/build/block.rs | 2 +- src/librustc_mir/build/mod.rs | 2 +- src/librustc_mir/hair/cx/block.rs | 2 +- src/librustc_mir/hair/cx/expr.rs | 6 +- src/librustc_mir/hair/cx/mod.rs | 2 +- src/librustc_mir/hair/cx/pattern.rs | 2 +- src/librustc_mir/hair/cx/to_ref.rs | 2 +- src/librustc_mir/hair/mod.rs | 2 +- src/librustc_mir/lib.rs | 1 - src/librustc_mir/mir_map.rs | 5 +- src/librustc_passes/Cargo.toml | 1 - src/librustc_passes/consts.rs | 4 +- src/librustc_passes/lib.rs | 1 - src/librustc_passes/loops.rs | 6 +- src/librustc_passes/rvalues.rs | 4 +- src/librustc_passes/static_recursion.rs | 6 +- src/librustc_plugin/Cargo.toml | 1 - src/librustc_plugin/build.rs | 6 +- src/librustc_plugin/lib.rs | 1 - src/librustc_privacy/Cargo.toml | 1 - src/librustc_privacy/lib.rs | 7 +-- src/librustc_resolve/Cargo.toml | 1 - src/librustc_resolve/build_reduced_graph.rs | 18 +++--- src/librustc_resolve/check_unused.rs | 6 +- src/librustc_resolve/lib.rs | 39 ++++++------- src/librustc_save_analysis/Cargo.toml | 1 - src/librustc_save_analysis/dump_visitor.rs | 2 +- src/librustc_save_analysis/lib.rs | 7 +-- src/librustc_trans/Cargo.toml | 1 - src/librustc_trans/_match.rs | 4 +- src/librustc_trans/abi.rs | 2 +- src/librustc_trans/asm.rs | 2 +- src/librustc_trans/assert_dep_graph.rs | 4 +- src/librustc_trans/back/link.rs | 2 +- src/librustc_trans/back/symbol_names.rs | 2 +- src/librustc_trans/base.rs | 9 ++- src/librustc_trans/callee.rs | 4 +- src/librustc_trans/closure.rs | 2 +- src/librustc_trans/collector.rs | 6 +- src/librustc_trans/common.rs | 2 +- src/librustc_trans/consts.rs | 4 +- src/librustc_trans/controlflow.rs | 4 +- .../debuginfo/create_scope_map.rs | 5 +- src/librustc_trans/debuginfo/metadata.rs | 4 +- src/librustc_trans/debuginfo/mod.rs | 7 +-- src/librustc_trans/debuginfo/namespace.rs | 2 +- src/librustc_trans/debuginfo/type_names.rs | 2 +- src/librustc_trans/expr.rs | 7 +-- src/librustc_trans/inline.rs | 2 +- src/librustc_trans/intrinsic.rs | 2 +- src/librustc_trans/lib.rs | 3 +- src/librustc_trans/mir/rvalue.rs | 2 +- src/librustc_trans/monomorphize.rs | 4 +- src/librustc_trans/symbol_names_test.rs | 4 +- src/librustc_trans/tvec.rs | 2 +- src/librustc_typeck/Cargo.toml | 1 - src/librustc_typeck/astconv.rs | 4 +- src/librustc_typeck/check/_match.rs | 6 +- src/librustc_typeck/check/callee.rs | 2 +- src/librustc_typeck/check/cast.rs | 2 +- src/librustc_typeck/check/closure.rs | 2 +- src/librustc_typeck/check/coercion.rs | 2 +- src/librustc_typeck/check/demand.rs | 2 +- src/librustc_typeck/check/intrinsic.rs | 2 +- src/librustc_typeck/check/method/confirm.rs | 2 +- src/librustc_typeck/check/method/mod.rs | 2 +- src/librustc_typeck/check/method/probe.rs | 2 +- src/librustc_typeck/check/method/suggest.rs | 10 ++-- src/librustc_typeck/check/mod.rs | 10 ++-- src/librustc_typeck/check/op.rs | 4 +- src/librustc_typeck/check/regionck.rs | 6 +- src/librustc_typeck/check/upvar.rs | 4 +- src/librustc_typeck/check/wfcheck.rs | 4 +- src/librustc_typeck/check/writeback.rs | 8 +-- src/librustc_typeck/coherence/mod.rs | 8 +-- src/librustc_typeck/coherence/orphan.rs | 4 +- src/librustc_typeck/coherence/overlap.rs | 4 +- src/librustc_typeck/coherence/unsafety.rs | 4 +- src/librustc_typeck/collect.rs | 8 +-- src/librustc_typeck/lib.rs | 6 +- src/librustc_typeck/variance/constraints.rs | 6 +- src/librustc_typeck/variance/terms.rs | 4 +- src/librustdoc/Cargo.toml | 1 - src/librustdoc/clean/inline.rs | 4 +- src/librustdoc/clean/mod.rs | 12 ++-- src/librustdoc/core.rs | 4 +- src/librustdoc/doctree.rs | 2 +- src/librustdoc/html/format.rs | 2 +- src/librustdoc/html/render.rs | 2 +- src/librustdoc/lib.rs | 1 - src/librustdoc/passes.rs | 2 +- src/librustdoc/test.rs | 6 +- src/librustdoc/visit_ast.rs | 4 +- src/rustc/Cargo.lock | 24 -------- src/test/auxiliary/dummy_mir_pass.rs | 1 - src/test/auxiliary/lint_for_crate.rs | 3 +- src/test/auxiliary/lint_group_plugin_test.rs | 4 +- src/test/run-make/execution-engine/test.rs | 5 +- 194 files changed, 419 insertions(+), 566 deletions(-) rename src/librustc/{front => hir}/check_attr.rs (100%) rename src/{librustc_front => librustc/hir}/fold.rs (100%) rename src/{librustc_front => librustc/hir}/intravisit.rs (100%) rename src/{librustc_front => librustc/hir}/lowering.rs (100%) rename src/librustc/{front => hir}/map/blocks.rs (98%) rename src/librustc/{front => hir}/map/collector.rs (99%) rename src/librustc/{front => hir}/map/definitions.rs (100%) rename src/librustc/{front => hir}/map/mod.rs (99%) rename src/{librustc_front/hir.rs => librustc/hir/mod.rs} (98%) rename src/{librustc_front/print/pprust.rs => librustc/hir/print.rs} (99%) rename src/{librustc_back => librustc/hir}/svh.rs (98%) rename src/{librustc_front => librustc/hir}/util.rs (99%) delete mode 100644 src/librustc_front/Cargo.toml delete mode 100644 src/librustc_front/lib.rs diff --git a/mk/crates.mk b/mk/crates.mk index 8c80335e772..4c06afcae0c 100644 --- a/mk/crates.mk +++ b/mk/crates.mk @@ -56,7 +56,7 @@ TARGET_CRATES := libc std term \ alloc_system alloc_jemalloc RUSTC_CRATES := rustc rustc_typeck rustc_mir rustc_borrowck rustc_resolve rustc_driver \ rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \ - rustc_data_structures rustc_front rustc_platform_intrinsics \ + rustc_data_structures rustc_platform_intrinsics \ rustc_plugin rustc_metadata rustc_passes rustc_save_analysis \ rustc_const_eval rustc_const_math HOST_CRATES := syntax syntax_ext $(RUSTC_CRATES) rustdoc fmt_macros \ @@ -93,38 +93,37 @@ DEPS_syntax := std term serialize log arena libc rustc_bitflags rustc_unicode DEPS_syntax_ext := syntax fmt_macros DEPS_rustc_const_math := std syntax log serialize -DEPS_rustc_const_eval := rustc_const_math rustc syntax log serialize rustc_front \ +DEPS_rustc_const_eval := rustc_const_math rustc syntax log serialize \ rustc_back graphviz -DEPS_rustc := syntax fmt_macros flate arena serialize getopts rbml rustc_front\ +DEPS_rustc := syntax fmt_macros flate arena serialize getopts rbml \ log graphviz rustc_back rustc_data_structures\ rustc_const_math -DEPS_rustc_back := std syntax rustc_front flate log libc -DEPS_rustc_borrowck := rustc rustc_front rustc_mir log graphviz syntax +DEPS_rustc_back := std syntax flate log libc +DEPS_rustc_borrowck := rustc rustc_mir log graphviz syntax DEPS_rustc_data_structures := std log serialize DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \ rustc_typeck rustc_mir rustc_resolve log syntax serialize rustc_llvm \ - rustc_trans rustc_privacy rustc_lint rustc_front rustc_plugin \ + rustc_trans rustc_privacy rustc_lint rustc_plugin \ rustc_metadata syntax_ext rustc_passes rustc_save_analysis rustc_const_eval -DEPS_rustc_front := std syntax log serialize DEPS_rustc_lint := rustc log syntax rustc_const_eval DEPS_rustc_llvm := native:rustllvm libc std rustc_bitflags -DEPS_rustc_metadata := rustc rustc_front syntax rbml rustc_const_math -DEPS_rustc_passes := syntax rustc core rustc_front rustc_const_eval -DEPS_rustc_mir := rustc rustc_front syntax rustc_const_math rustc_const_eval -DEPS_rustc_resolve := arena rustc rustc_front log syntax +DEPS_rustc_metadata := rustc syntax rbml rustc_const_math +DEPS_rustc_passes := syntax rustc core rustc_const_eval +DEPS_rustc_mir := rustc syntax rustc_const_math rustc_const_eval +DEPS_rustc_resolve := arena rustc log syntax DEPS_rustc_platform_intrinsics := std DEPS_rustc_plugin := rustc rustc_metadata syntax rustc_mir -DEPS_rustc_privacy := rustc rustc_front log syntax +DEPS_rustc_privacy := rustc log syntax DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back rustc_mir \ - log syntax serialize rustc_llvm rustc_front rustc_platform_intrinsics \ + log syntax serialize rustc_llvm rustc_platform_intrinsics \ rustc_const_math rustc_const_eval -DEPS_rustc_save_analysis := rustc log syntax rustc_front -DEPS_rustc_typeck := rustc syntax rustc_front rustc_platform_intrinsics rustc_const_math \ +DEPS_rustc_save_analysis := rustc log syntax +DEPS_rustc_typeck := rustc syntax rustc_platform_intrinsics rustc_const_math \ rustc_const_eval DEPS_rustdoc := rustc rustc_driver native:hoedown serialize getopts \ - test rustc_lint rustc_front rustc_const_eval + test rustc_lint rustc_const_eval TOOL_DEPS_compiletest := test getopts log diff --git a/src/librustc/Cargo.toml b/src/librustc/Cargo.toml index e7aaaef45a1..d77268219fc 100644 --- a/src/librustc/Cargo.toml +++ b/src/librustc/Cargo.toml @@ -19,6 +19,5 @@ rustc_back = { path = "../librustc_back" } rustc_bitflags = { path = "../librustc_bitflags" } rustc_const_math = { path = "../librustc_const_math" } rustc_data_structures = { path = "../librustc_data_structures" } -rustc_front = { path = "../librustc_front" } serialize = { path = "../libserialize" } syntax = { path = "../libsyntax" } diff --git a/src/librustc/cfg/construct.rs b/src/librustc/cfg/construct.rs index cd1e3b5f30e..4fc0a092613 100644 --- a/src/librustc/cfg/construct.rs +++ b/src/librustc/cfg/construct.rs @@ -16,7 +16,7 @@ use ty::{self, TyCtxt}; use syntax::ast; use syntax::ptr::P; -use rustc_front::hir::{self, PatKind}; +use hir::{self, PatKind}; struct CFGBuilder<'a, 'tcx: 'a> { tcx: &'a TyCtxt<'tcx>, @@ -257,7 +257,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> { self.match_(expr.id, &discr, &arms, pred) } - hir::ExprBinary(op, ref l, ref r) if ::rustc_front::util::lazy_binop(op.node) => { + hir::ExprBinary(op, ref l, ref r) if hir::util::lazy_binop(op.node) => { // // [pred] // | diff --git a/src/librustc/cfg/graphviz.rs b/src/librustc/cfg/graphviz.rs index c867ec94b25..c651baae282 100644 --- a/src/librustc/cfg/graphviz.rs +++ b/src/librustc/cfg/graphviz.rs @@ -17,7 +17,7 @@ use graphviz::IntoCow; use syntax::ast; -use front::map as ast_map; +use hir::map as ast_map; use cfg; pub type Node<'a> = (cfg::CFGIndex, &'a cfg::CFGNode); diff --git a/src/librustc/cfg/mod.rs b/src/librustc/cfg/mod.rs index 8df4dc5fce5..e86bf6ebc58 100644 --- a/src/librustc/cfg/mod.rs +++ b/src/librustc/cfg/mod.rs @@ -14,7 +14,7 @@ use rustc_data_structures::graph; use ty::TyCtxt; use syntax::ast; -use rustc_front::hir; +use hir; mod construct; pub mod graphviz; diff --git a/src/librustc/dep_graph/mod.rs b/src/librustc/dep_graph/mod.rs index 731c33868df..70e7f675fce 100644 --- a/src/librustc/dep_graph/mod.rs +++ b/src/librustc/dep_graph/mod.rs @@ -12,8 +12,8 @@ use self::thread::{DepGraphThreadData, DepMessage}; use middle::def_id::DefId; use syntax::ast::NodeId; use ty::TyCtxt; -use rustc_front::hir; -use rustc_front::intravisit::Visitor; +use hir; +use hir::intravisit::Visitor; use std::rc::Rc; mod dep_tracking_map; diff --git a/src/librustc/front/check_attr.rs b/src/librustc/hir/check_attr.rs similarity index 100% rename from src/librustc/front/check_attr.rs rename to src/librustc/hir/check_attr.rs diff --git a/src/librustc_front/fold.rs b/src/librustc/hir/fold.rs similarity index 100% rename from src/librustc_front/fold.rs rename to src/librustc/hir/fold.rs diff --git a/src/librustc_front/intravisit.rs b/src/librustc/hir/intravisit.rs similarity index 100% rename from src/librustc_front/intravisit.rs rename to src/librustc/hir/intravisit.rs diff --git a/src/librustc_front/lowering.rs b/src/librustc/hir/lowering.rs similarity index 100% rename from src/librustc_front/lowering.rs rename to src/librustc/hir/lowering.rs diff --git a/src/librustc/front/map/blocks.rs b/src/librustc/hir/map/blocks.rs similarity index 98% rename from src/librustc/front/map/blocks.rs rename to src/librustc/hir/map/blocks.rs index 2eb3d56bb5e..7b1c692d54b 100644 --- a/src/librustc/front/map/blocks.rs +++ b/src/librustc/hir/map/blocks.rs @@ -23,14 +23,14 @@ pub use self::Code::*; -use front::map::{self, Node}; +use hir::map::{self, Node}; use syntax::abi; -use rustc_front::hir::{Block, FnDecl}; +use hir::{Block, FnDecl}; use syntax::ast::{Attribute, Name, NodeId}; use syntax::attr::ThinAttributesExt; -use rustc_front::hir as ast; +use hir as ast; use syntax::codemap::Span; -use rustc_front::intravisit::FnKind; +use hir::intravisit::FnKind; /// An FnLikeNode is a Node that is like a fn, in that it has a decl /// and a body (as well as a NodeId, a span, etc). diff --git a/src/librustc/front/map/collector.rs b/src/librustc/hir/map/collector.rs similarity index 99% rename from src/librustc/front/map/collector.rs rename to src/librustc/hir/map/collector.rs index 4ae03b1b9d7..70368222172 100644 --- a/src/librustc/front/map/collector.rs +++ b/src/librustc/hir/map/collector.rs @@ -11,9 +11,8 @@ use super::*; use super::MapEntry::*; -use rustc_front::hir::*; -use rustc_front::util; -use rustc_front::intravisit::{self, Visitor}; +use hir::*; +use hir::intravisit::Visitor; use middle::def_id::{CRATE_DEF_INDEX, DefId, DefIndex}; use std::iter::repeat; use syntax::ast::{NodeId, CRATE_NODE_ID, DUMMY_NODE_ID}; diff --git a/src/librustc/front/map/definitions.rs b/src/librustc/hir/map/definitions.rs similarity index 100% rename from src/librustc/front/map/definitions.rs rename to src/librustc/hir/map/definitions.rs diff --git a/src/librustc/front/map/mod.rs b/src/librustc/hir/map/mod.rs similarity index 99% rename from src/librustc/front/map/mod.rs rename to src/librustc/hir/map/mod.rs index 817bec58407..4325be9b9a4 100644 --- a/src/librustc/front/map/mod.rs +++ b/src/librustc/hir/map/mod.rs @@ -27,10 +27,9 @@ use syntax::attr::ThinAttributesExt; use syntax::codemap::{Span, Spanned}; use syntax::parse::token; -use rustc_front::hir::*; -use rustc_front::fold::Folder; -use rustc_front::intravisit; -use rustc_front::print::pprust; +use hir::*; +use hir::fold::Folder; +use hir::print as pprust; use arena::TypedArena; use std::cell::RefCell; diff --git a/src/librustc_front/hir.rs b/src/librustc/hir/mod.rs similarity index 98% rename from src/librustc_front/hir.rs rename to src/librustc/hir/mod.rs index 86f8635f58d..eaf59af2cc3 100644 --- a/src/librustc_front/hir.rs +++ b/src/librustc/hir/mod.rs @@ -33,8 +33,6 @@ pub use self::ViewPath_::*; pub use self::Visibility::*; pub use self::PathParameters::*; -use intravisit::Visitor; -use std::collections::BTreeMap; use syntax::codemap::{self, Span, Spanned, DUMMY_SP, ExpnId}; use syntax::abi::Abi; use syntax::ast::{Name, NodeId, DUMMY_NODE_ID, TokenTree, AsmDialect}; @@ -43,9 +41,7 @@ use syntax::attr::{ThinAttributes, ThinAttributesExt}; use syntax::parse::token::InternedString; use syntax::ptr::P; -use print::pprust; -use util; - +use std::collections::BTreeMap; use std::fmt; use std::hash::{Hash, Hasher}; use serialize::{Encodable, Decodable, Encoder, Decoder}; @@ -66,6 +62,15 @@ macro_rules! hir_vec { ($($x:expr,)*) => (vec![$($x),*]) } +pub mod check_attr; +pub mod fold; +pub mod intravisit; +pub mod lowering; +pub mod map; +pub mod print; +pub mod svh; +pub mod util; + /// Identifier in HIR #[derive(Clone, Copy, Eq)] pub struct Ident { @@ -135,7 +140,7 @@ impl fmt::Debug for Lifetime { write!(f, "lifetime({}: {})", self.id, - pprust::lifetime_to_string(self)) + print::lifetime_to_string(self)) } } @@ -161,13 +166,13 @@ pub struct Path { impl fmt::Debug for Path { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "path({})", pprust::path_to_string(self)) + write!(f, "path({})", print::path_to_string(self)) } } impl fmt::Display for Path { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", pprust::path_to_string(self)) + write!(f, "{}", print::path_to_string(self)) } } @@ -434,7 +439,9 @@ impl Crate { /// follows lexical scoping rules -- then you want a different /// approach. You should override `visit_nested_item` in your /// visitor and then call `intravisit::walk_crate` instead. - pub fn visit_all_items<'hir, V:Visitor<'hir>>(&'hir self, visitor: &mut V) { + pub fn visit_all_items<'hir, V>(&'hir self, visitor: &mut V) + where V: intravisit::Visitor<'hir> + { for (_, item) in &self.items { visitor.visit_item(item); } @@ -479,7 +486,7 @@ pub struct Pat { impl fmt::Debug for Pat { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "pat({}: {})", self.id, pprust::pat_to_string(self)) + write!(f, "pat({}: {})", self.id, print::pat_to_string(self)) } } @@ -619,7 +626,7 @@ impl fmt::Debug for Stmt_ { write!(f, "stmt({}: {})", util::stmt_id(&spanned), - pprust::stmt_to_string(&spanned)) + print::stmt_to_string(&spanned)) } } @@ -722,7 +729,7 @@ pub struct Expr { impl fmt::Debug for Expr { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "expr({}: {})", self.id, pprust::expr_to_string(self)) + write!(f, "expr({}: {})", self.id, print::expr_to_string(self)) } } @@ -940,7 +947,7 @@ pub struct Ty { impl fmt::Debug for Ty { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "type({})", pprust::ty_to_string(self)) + write!(f, "type({})", print::ty_to_string(self)) } } diff --git a/src/librustc_front/print/pprust.rs b/src/librustc/hir/print.rs similarity index 99% rename from src/librustc_front/print/pprust.rs rename to src/librustc/hir/print.rs index 3b8e6763de0..568986f39c5 100644 --- a/src/librustc_front/print/pprust.rs +++ b/src/librustc/hir/print.rs @@ -950,7 +950,7 @@ impl<'a> State<'a> { pub fn print_variant(&mut self, v: &hir::Variant) -> io::Result<()> { self.head("")?; - let generics = ::util::empty_generics(); + let generics = hir::util::empty_generics(); self.print_struct(&v.node.data, &generics, v.node.name, v.span, false)?; match v.node.disr_expr { Some(ref d) => { @@ -1285,12 +1285,12 @@ impl<'a> State<'a> { -> io::Result<()> { self.print_expr(lhs)?; space(&mut self.s)?; - self.word_space(::util::binop_to_string(op.node))?; + self.word_space(hir::util::binop_to_string(op.node))?; self.print_expr(rhs) } fn print_expr_unary(&mut self, op: hir::UnOp, expr: &hir::Expr) -> io::Result<()> { - word(&mut self.s, ::util::unop_to_string(op))?; + word(&mut self.s, hir::util::unop_to_string(op))?; self.print_expr_maybe_paren(expr) } @@ -1434,7 +1434,7 @@ impl<'a> State<'a> { hir::ExprAssignOp(op, ref lhs, ref rhs) => { self.print_expr(&lhs)?; space(&mut self.s)?; - word(&mut self.s, ::util::binop_to_string(op.node))?; + word(&mut self.s, hir::util::binop_to_string(op.node))?; self.word_space("=")?; self.print_expr(&rhs)?; } diff --git a/src/librustc_back/svh.rs b/src/librustc/hir/svh.rs similarity index 98% rename from src/librustc_back/svh.rs rename to src/librustc/hir/svh.rs index ec607314f45..7ae20f68ad0 100644 --- a/src/librustc_back/svh.rs +++ b/src/librustc/hir/svh.rs @@ -48,8 +48,8 @@ use std::fmt; use std::hash::{Hash, SipHasher, Hasher}; -use rustc_front::hir; -use rustc_front::intravisit as visit; +use hir; +use hir::intravisit as visit; #[derive(Clone, PartialEq, Debug)] pub struct Svh { @@ -134,10 +134,10 @@ mod svh_visitor { use syntax::ast::{self, Name, NodeId}; use syntax::codemap::Span; use syntax::parse::token; - use rustc_front::intravisit as visit; - use rustc_front::intravisit::{Visitor, FnKind}; - use rustc_front::hir::*; - use rustc_front::hir; + use hir::intravisit as visit; + use hir::intravisit::{Visitor, FnKind}; + use hir::*; + use hir; use std::hash::{Hash, SipHasher}; diff --git a/src/librustc_front/util.rs b/src/librustc/hir/util.rs similarity index 99% rename from src/librustc_front/util.rs rename to src/librustc/hir/util.rs index f4f9cb75eaf..7745c320e76 100644 --- a/src/librustc_front/util.rs +++ b/src/librustc/hir/util.rs @@ -10,7 +10,7 @@ use hir; use hir::*; -use intravisit::{self, Visitor, FnKind}; +use hir::intravisit::{Visitor, FnKind}; use syntax::ast_util; use syntax::ast::{Name, NodeId, DUMMY_NODE_ID}; use syntax::codemap::Span; diff --git a/src/librustc/infer/error_reporting.rs b/src/librustc/infer/error_reporting.rs index 8079a6d1bbc..c0c63ac5042 100644 --- a/src/librustc/infer/error_reporting.rs +++ b/src/librustc/infer/error_reporting.rs @@ -73,9 +73,9 @@ use super::region_inference::SameRegions; use std::collections::HashSet; -use front::map as ast_map; -use rustc_front::hir; -use rustc_front::print::pprust; +use hir::map as ast_map; +use hir; +use hir::print as pprust; use middle::cstore::CrateStore; use middle::def::Def; diff --git a/src/librustc/infer/mod.rs b/src/librustc/infer/mod.rs index e22fb988904..427ff88b8f2 100644 --- a/src/librustc/infer/mod.rs +++ b/src/librustc/infer/mod.rs @@ -19,7 +19,7 @@ pub use self::freshen::TypeFreshener; pub use self::region_inference::{GenericKind, VerifyBound}; use middle::def_id::DefId; -use rustc_front::hir; +use hir; use middle::free_region::FreeRegionMap; use middle::mem_categorization as mc; use middle::mem_categorization::McResult; diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index 03a08231c74..291eab30dec 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -38,6 +38,7 @@ #![feature(rustc_private)] #![feature(slice_patterns)] #![feature(staged_api)] +#![feature(step_by)] #![feature(str_char)] #![feature(question_mark)] #![cfg_attr(test, feature(test))] @@ -51,7 +52,6 @@ extern crate graphviz; extern crate libc; extern crate rbml; extern crate rustc_back; -extern crate rustc_front; extern crate rustc_data_structures; extern crate serialize; extern crate collections; @@ -72,19 +72,9 @@ mod macros; // registered before they are used. pub mod diagnostics; -pub mod back { - pub use rustc_back::rpath; - pub use rustc_back::svh; -} - pub mod cfg; pub mod dep_graph; - -pub mod front { - pub mod check_attr; - pub mod map; -} - +pub mod hir; pub mod infer; pub mod lint; diff --git a/src/librustc/lint/context.rs b/src/librustc/lint/context.rs index e78ff513ac4..83244352769 100644 --- a/src/librustc/lint/context.rs +++ b/src/librustc/lint/context.rs @@ -46,9 +46,9 @@ use syntax::errors::DiagnosticBuilder; use syntax::parse::token::InternedString; use syntax::ast; use syntax::attr::ThinAttributesExt; -use rustc_front::hir; -use rustc_front::util; -use rustc_front::intravisit as hir_visit; +use hir; +use hir::util; +use hir::intravisit as hir_visit; use syntax::visit as ast_visit; /// Information about the registered lints. diff --git a/src/librustc/lint/mod.rs b/src/librustc/lint/mod.rs index 133d0163a8c..28994e1a7c4 100644 --- a/src/librustc/lint/mod.rs +++ b/src/librustc/lint/mod.rs @@ -34,10 +34,10 @@ pub use self::LintSource::*; use std::hash; use std::ascii::AsciiExt; use syntax::codemap::Span; -use rustc_front::intravisit::FnKind; +use hir::intravisit::FnKind; use syntax::visit as ast_visit; use syntax::ast; -use rustc_front::hir; +use hir; pub use lint::context::{LateContext, EarlyContext, LintContext, LintStore, raw_emit_lint, check_crate, check_ast_crate, gather_attrs, diff --git a/src/librustc/middle/astconv_util.rs b/src/librustc/middle/astconv_util.rs index b86d74545cb..871440a7e54 100644 --- a/src/librustc/middle/astconv_util.rs +++ b/src/librustc/middle/astconv_util.rs @@ -18,7 +18,7 @@ use middle::def::Def; use ty::{Ty, TyCtxt}; use syntax::codemap::Span; -use rustc_front::hir as ast; +use hir as ast; pub fn prohibit_type_params(tcx: &TyCtxt, segments: &[ast::PathSegment]) { for segment in segments { diff --git a/src/librustc/middle/cstore.rs b/src/librustc/middle/cstore.rs index 4efb40abdb0..59a3ab44645 100644 --- a/src/librustc/middle/cstore.rs +++ b/src/librustc/middle/cstore.rs @@ -22,8 +22,8 @@ // are *mostly* used as a part of that interface, but these should // probably get a better home if someone can find one. -use back::svh::Svh; -use front::map as hir_map; +use hir::svh::Svh; +use hir::map as hir_map; use middle::def::{self, Def}; use middle::lang_items; use ty::{self, Ty, TyCtxt, VariantKind}; @@ -44,9 +44,9 @@ use syntax::codemap::Span; use syntax::ptr::P; use syntax::parse::token::InternedString; use rustc_back::target::Target; -use rustc_front::hir; -use rustc_front::intravisit::Visitor; -use rustc_front::util::IdVisitor; +use hir; +use hir::intravisit::Visitor; +use hir::util::IdVisitor; pub use self::DefLike::{DlDef, DlField, DlImpl}; pub use self::NativeLibraryKind::{NativeStatic, NativeFramework, NativeUnknown}; diff --git a/src/librustc/middle/dataflow.rs b/src/librustc/middle/dataflow.rs index 6468187e219..99b512141a4 100644 --- a/src/librustc/middle/dataflow.rs +++ b/src/librustc/middle/dataflow.rs @@ -25,9 +25,9 @@ use syntax::ast_util::IdRange; use syntax::print::pp; use syntax::print::pprust::PrintState; use util::nodemap::NodeMap; -use rustc_front::hir; -use rustc_front::intravisit; -use rustc_front::print::pprust; +use hir; +use hir::intravisit; +use hir::print as pprust; #[derive(Copy, Clone, Debug)] diff --git a/src/librustc/middle/dead.rs b/src/librustc/middle/dead.rs index 18bea745858..b7b6279270c 100644 --- a/src/librustc/middle/dead.rs +++ b/src/librustc/middle/dead.rs @@ -13,9 +13,9 @@ // from live codes are live, and everything else is dead. use dep_graph::DepNode; -use front::map as ast_map; -use rustc_front::hir::{self, PatKind}; -use rustc_front::intravisit::{self, Visitor}; +use hir::map as ast_map; +use hir::{self, PatKind}; +use hir::intravisit::{self, Visitor}; use middle::{pat_util, privacy}; use ty::{self, TyCtxt}; diff --git a/src/librustc/middle/def.rs b/src/librustc/middle/def.rs index e6ea000936c..ee6e747a855 100644 --- a/src/librustc/middle/def.rs +++ b/src/librustc/middle/def.rs @@ -12,7 +12,7 @@ use middle::def_id::DefId; use ty::subst::ParamSpace; use util::nodemap::NodeMap; use syntax::ast; -use rustc_front::hir; +use hir; #[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub enum Def { diff --git a/src/librustc/middle/effect.rs b/src/librustc/middle/effect.rs index fa949073f4e..e4c93dfdb93 100644 --- a/src/librustc/middle/effect.rs +++ b/src/librustc/middle/effect.rs @@ -19,9 +19,9 @@ use ty::MethodCall; use syntax::ast; use syntax::codemap::Span; -use rustc_front::hir; -use rustc_front::intravisit; -use rustc_front::intravisit::{FnKind, Visitor}; +use hir; +use hir::intravisit; +use hir::intravisit::{FnKind, Visitor}; #[derive(Copy, Clone)] struct UnsafeContext { diff --git a/src/librustc/middle/entry.rs b/src/librustc/middle/entry.rs index 67e96816abf..4a64980fcdd 100644 --- a/src/librustc/middle/entry.rs +++ b/src/librustc/middle/entry.rs @@ -10,15 +10,15 @@ use dep_graph::DepNode; -use front::map as ast_map; +use hir::map as ast_map; use middle::def_id::{CRATE_DEF_INDEX}; use session::{config, Session}; use syntax::ast::NodeId; use syntax::attr; use syntax::codemap::Span; use syntax::entry::EntryPointType; -use rustc_front::hir::{Item, ItemFn}; -use rustc_front::intravisit::Visitor; +use hir::{Item, ItemFn}; +use hir::intravisit::Visitor; struct EntryContext<'a, 'tcx: 'a> { session: &'a Session, diff --git a/src/librustc/middle/expr_use_visitor.rs b/src/librustc/middle/expr_use_visitor.rs index bfc96005bc8..47ec7ab5ff0 100644 --- a/src/librustc/middle/expr_use_visitor.rs +++ b/src/librustc/middle/expr_use_visitor.rs @@ -26,7 +26,7 @@ use infer; use middle::mem_categorization as mc; use ty::{self, TyCtxt, adjustment}; -use rustc_front::hir::{self, PatKind}; +use hir::{self, PatKind}; use syntax::ast; use syntax::ptr::P; @@ -479,7 +479,7 @@ impl<'d,'t,'a,'tcx> ExprUseVisitor<'d,'t,'a,'tcx> { } hir::ExprUnary(op, ref lhs) => { - let pass_args = if ::rustc_front::util::is_by_value_unop(op) { + let pass_args = if hir::util::is_by_value_unop(op) { PassArgs::ByValue } else { PassArgs::ByRef @@ -491,7 +491,7 @@ impl<'d,'t,'a,'tcx> ExprUseVisitor<'d,'t,'a,'tcx> { } hir::ExprBinary(op, ref lhs, ref rhs) => { - let pass_args = if ::rustc_front::util::is_by_value_binop(op.node) { + let pass_args = if hir::util::is_by_value_binop(op.node) { PassArgs::ByValue } else { PassArgs::ByRef @@ -524,7 +524,7 @@ impl<'d,'t,'a,'tcx> ExprUseVisitor<'d,'t,'a,'tcx> { hir::ExprAssignOp(op, ref lhs, ref rhs) => { // NB All our assignment operations take the RHS by value - assert!(::rustc_front::util::is_by_value_binop(op.node)); + assert!(hir::util::is_by_value_binop(op.node)); if !self.walk_overloaded_operator(expr, lhs, vec![rhs], PassArgs::ByValue) { self.mutate_expr(expr, &lhs, MutateMode::WriteAndRead); diff --git a/src/librustc/middle/intrinsicck.rs b/src/librustc/middle/intrinsicck.rs index fd74ccac975..354a6c5e13b 100644 --- a/src/librustc/middle/intrinsicck.rs +++ b/src/librustc/middle/intrinsicck.rs @@ -20,8 +20,8 @@ use std::fmt; use syntax::abi::Abi::RustIntrinsic; use syntax::ast; use syntax::codemap::Span; -use rustc_front::intravisit::{self, Visitor, FnKind}; -use rustc_front::hir; +use hir::intravisit::{self, Visitor, FnKind}; +use hir; pub fn check_crate(tcx: &TyCtxt) { let mut visitor = IntrinsicCheckingVisitor { diff --git a/src/librustc/middle/lang_items.rs b/src/librustc/middle/lang_items.rs index bb0b8ed91df..7aad106c4ed 100644 --- a/src/librustc/middle/lang_items.rs +++ b/src/librustc/middle/lang_items.rs @@ -22,7 +22,7 @@ pub use self::LangItem::*; use dep_graph::DepNode; -use front::map as hir_map; +use hir::map as hir_map; use session::Session; use middle::cstore::CrateStore; use middle::def_id::DefId; @@ -33,8 +33,8 @@ use util::nodemap::FnvHashMap; use syntax::ast; use syntax::attr::AttrMetaMethods; use syntax::parse::token::InternedString; -use rustc_front::intravisit::Visitor; -use rustc_front::hir; +use hir::intravisit::Visitor; +use hir; // The actual lang items defined come at the end of this file in one handy table. // So you probably just want to nip down to the end. diff --git a/src/librustc/middle/liveness.rs b/src/librustc/middle/liveness.rs index 4451e7ac472..8d429ff2384 100644 --- a/src/librustc/middle/liveness.rs +++ b/src/librustc/middle/liveness.rs @@ -128,10 +128,10 @@ use syntax::codemap::{BytePos, original_sp, Span}; use syntax::parse::token::special_idents; use syntax::ptr::P; -use rustc_front::hir::Expr; -use rustc_front::hir; -use rustc_front::print::pprust::{expr_to_string, block_to_string}; -use rustc_front::intravisit::{self, Visitor, FnKind}; +use hir::Expr; +use hir; +use hir::print::{expr_to_string, block_to_string}; +use hir::intravisit::{self, Visitor, FnKind}; /// For use with `propagate_through_loop`. enum LoopKind<'a> { @@ -484,7 +484,7 @@ fn visit_expr(ir: &mut IrMaps, expr: &Expr) { ir.add_live_node_for_node(expr.id, ExprNode(expr.span)); intravisit::walk_expr(ir, expr); } - hir::ExprBinary(op, _, _) if ::rustc_front::util::lazy_binop(op.node) => { + hir::ExprBinary(op, _, _) if hir::util::lazy_binop(op.node) => { ir.add_live_node_for_node(expr.id, ExprNode(expr.span)); intravisit::walk_expr(ir, expr); } @@ -1142,7 +1142,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> { self.propagate_through_exprs(&exprs[..], succ) } - hir::ExprBinary(op, ref l, ref r) if ::rustc_front::util::lazy_binop(op.node) => { + hir::ExprBinary(op, ref l, ref r) if hir::util::lazy_binop(op.node) => { let r_succ = self.propagate_through_expr(&r, succ); let ln = self.live_node(expr.id, expr.span); diff --git a/src/librustc/middle/mem_categorization.rs b/src/librustc/middle/mem_categorization.rs index ef031ad13f1..7260bdde3ee 100644 --- a/src/librustc/middle/mem_categorization.rs +++ b/src/librustc/middle/mem_categorization.rs @@ -72,15 +72,15 @@ pub use self::deref_kind::*; use self::Aliasability::*; use middle::def_id::DefId; -use front::map as ast_map; +use hir::map as ast_map; use infer; use middle::const_qualif::ConstQualif; use middle::def::Def; use ty::adjustment; use ty::{self, Ty, TyCtxt}; -use rustc_front::hir::{MutImmutable, MutMutable, PatKind}; -use rustc_front::hir; +use hir::{MutImmutable, MutMutable, PatKind}; +use hir; use syntax::ast; use syntax::codemap::Span; diff --git a/src/librustc/middle/pat_util.rs b/src/librustc/middle/pat_util.rs index b2b1344c4bb..3cd69603b5b 100644 --- a/src/librustc/middle/pat_util.rs +++ b/src/librustc/middle/pat_util.rs @@ -14,8 +14,8 @@ use ty::TyCtxt; use util::nodemap::FnvHashMap; use syntax::ast; -use rustc_front::hir::{self, PatKind}; -use rustc_front::util::walk_pat; +use hir::{self, PatKind}; +use hir::util::walk_pat; use syntax::codemap::{respan, Span, Spanned, DUMMY_SP}; use std::cell::RefCell; diff --git a/src/librustc/middle/reachable.rs b/src/librustc/middle/reachable.rs index 149e895717c..8c44594c1f7 100644 --- a/src/librustc/middle/reachable.rs +++ b/src/librustc/middle/reachable.rs @@ -16,7 +16,7 @@ // reachable as well. use dep_graph::DepNode; -use front::map as ast_map; +use hir::map as ast_map; use middle::def::Def; use middle::def_id::DefId; use ty::{self, TyCtxt}; @@ -28,9 +28,9 @@ use std::collections::HashSet; use syntax::abi::Abi; use syntax::ast; use syntax::attr; -use rustc_front::hir; -use rustc_front::intravisit::Visitor; -use rustc_front::intravisit; +use hir; +use hir::intravisit::Visitor; +use hir::intravisit; // Returns true if the given set of generics implies that the item it's // associated with must be inlined. diff --git a/src/librustc/middle/region.rs b/src/librustc/middle/region.rs index 2cde6ce9320..99ebf5ccb84 100644 --- a/src/librustc/middle/region.rs +++ b/src/librustc/middle/region.rs @@ -17,7 +17,7 @@ //! `middle/infer/region_inference/README.md` use dep_graph::DepNode; -use front::map as ast_map; +use hir::map as ast_map; use session::Session; use util::nodemap::{FnvHashMap, NodeMap, NodeSet}; use middle::cstore::InlinedItem; @@ -30,10 +30,10 @@ use std::mem; use syntax::codemap::{self, Span}; use syntax::ast::{self, NodeId}; -use rustc_front::hir; -use rustc_front::intravisit::{self, Visitor, FnKind}; -use rustc_front::hir::{Block, Item, FnDecl, Arm, Pat, PatKind, Stmt, Expr, Local}; -use rustc_front::util::stmt_id; +use hir; +use hir::intravisit::{self, Visitor, FnKind}; +use hir::{Block, Item, FnDecl, Arm, Pat, PatKind, Stmt, Expr, Local}; +use hir::util::stmt_id; #[derive(Clone, PartialEq, PartialOrd, Eq, Ord, Hash, RustcEncodable, RustcDecodable, Copy)] diff --git a/src/librustc/middle/resolve_lifetime.rs b/src/librustc/middle/resolve_lifetime.rs index d3757629d30..1275753a340 100644 --- a/src/librustc/middle/resolve_lifetime.rs +++ b/src/librustc/middle/resolve_lifetime.rs @@ -19,7 +19,7 @@ pub use self::DefRegion::*; use self::ScopeChain::*; use dep_graph::DepNode; -use front::map::Map; +use hir::map::Map; use session::Session; use middle::def::{Def, DefMap}; use middle::region; @@ -32,9 +32,9 @@ use syntax::codemap::Span; use syntax::parse::token::special_idents; use util::nodemap::NodeMap; -use rustc_front::hir; -use rustc_front::print::pprust::lifetime_to_string; -use rustc_front::intravisit::{self, Visitor, FnKind}; +use hir; +use hir::print::lifetime_to_string; +use hir::intravisit::{self, Visitor, FnKind}; #[derive(Clone, Copy, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable, Debug)] pub enum DefRegion { diff --git a/src/librustc/middle/stability.rs b/src/librustc/middle/stability.rs index e589743222b..ffb4a791363 100644 --- a/src/librustc/middle/stability.rs +++ b/src/librustc/middle/stability.rs @@ -14,7 +14,7 @@ pub use self::StabilityLevel::*; use dep_graph::DepNode; -use front::map as hir_map; +use hir::map as hir_map; use session::Session; use lint; use middle::cstore::{CrateStore, LOCAL_CRATE}; @@ -30,9 +30,9 @@ use syntax::feature_gate::{GateIssue, emit_feature_err}; use syntax::attr::{self, Stability, Deprecation, AttrMetaMethods}; use util::nodemap::{DefIdMap, FnvHashSet, FnvHashMap}; -use rustc_front::hir; -use rustc_front::hir::{Item, Generics, StructField, Variant, PatKind}; -use rustc_front::intravisit::{self, Visitor}; +use hir; +use hir::{Item, Generics, StructField, Variant, PatKind}; +use hir::intravisit::{self, Visitor}; use std::mem::replace; use std::cmp::Ordering; diff --git a/src/librustc/middle/weak_lang_items.rs b/src/librustc/middle/weak_lang_items.rs index 6059d7ee74e..74bb41785cb 100644 --- a/src/librustc/middle/weak_lang_items.rs +++ b/src/librustc/middle/weak_lang_items.rs @@ -18,9 +18,9 @@ use middle::lang_items; use syntax::ast; use syntax::codemap::Span; use syntax::parse::token::InternedString; -use rustc_front::intravisit::Visitor; -use rustc_front::intravisit; -use rustc_front::hir; +use hir::intravisit::Visitor; +use hir::intravisit; +use hir; use std::collections::HashSet; diff --git a/src/librustc/mir/repr.rs b/src/librustc/mir/repr.rs index a33ee6bd204..1b24b4f6210 100644 --- a/src/librustc/mir/repr.rs +++ b/src/librustc/mir/repr.rs @@ -16,7 +16,7 @@ use ty::subst::Substs; use ty::{self, AdtDef, ClosureSubsts, FnOutput, Region, Ty}; use util::ppaux; use rustc_back::slice; -use rustc_front::hir::InlineAsm; +use hir::InlineAsm; use std::ascii; use std::borrow::{Cow}; use std::fmt::{self, Debug, Formatter, Write}; diff --git a/src/librustc/mir/tcx.rs b/src/librustc/mir/tcx.rs index ecac5d2f73f..d710417bf20 100644 --- a/src/librustc/mir/tcx.rs +++ b/src/librustc/mir/tcx.rs @@ -17,7 +17,7 @@ use mir::repr::*; use ty::subst::{Subst, Substs}; use ty::{self, AdtDef, Ty, TyCtxt}; use ty::fold::{TypeFoldable, TypeFolder, TypeVisitor}; -use rustc_front::hir; +use hir; #[derive(Copy, Clone, Debug)] pub enum LvalueTy<'tcx> { diff --git a/src/librustc/traits/select.rs b/src/librustc/traits/select.rs index f68386feddb..97c9caadd52 100644 --- a/src/librustc/traits/select.rs +++ b/src/librustc/traits/select.rs @@ -49,7 +49,7 @@ use std::cell::RefCell; use std::fmt; use std::rc::Rc; use syntax::abi::Abi; -use rustc_front::hir; +use hir; use util::common::ErrorReported; use util::nodemap::FnvHashMap; diff --git a/src/librustc/ty/adjustment.rs b/src/librustc/ty/adjustment.rs index 90ccdeea928..41008823c85 100644 --- a/src/librustc/ty/adjustment.rs +++ b/src/librustc/ty/adjustment.rs @@ -17,7 +17,7 @@ use ty::LvaluePreference::{NoPreference}; use syntax::ast; use syntax::codemap::Span; -use rustc_front::hir; +use hir; #[derive(Copy, Clone)] pub enum AutoAdjustment<'tcx> { diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs index 2074339f2e6..fa5a7f3ca69 100644 --- a/src/librustc/ty/context.rs +++ b/src/librustc/ty/context.rs @@ -11,7 +11,7 @@ //! type context book-keeping use dep_graph::{DepGraph, DepTrackingMap}; -use front::map as ast_map; +use hir::map as ast_map; use session::Session; use lint; use middle; @@ -45,7 +45,7 @@ use syntax::ast::{self, Name, NodeId}; use syntax::attr; use syntax::parse::token::{self, special_idents}; -use rustc_front::hir; +use hir; /// Internal storage pub struct CtxtArenas<'tcx> { diff --git a/src/librustc/ty/error.rs b/src/librustc/ty/error.rs index 9ab48505828..e6b7b49ea57 100644 --- a/src/librustc/ty/error.rs +++ b/src/librustc/ty/error.rs @@ -19,7 +19,7 @@ use syntax::ast::{self, Name}; use syntax::codemap::Span; use syntax::errors::DiagnosticBuilder; -use rustc_front::hir; +use hir; #[derive(Clone, Copy, Debug)] pub struct ExpectedFound { diff --git a/src/librustc/ty/item_path.rs b/src/librustc/ty/item_path.rs index caf7e6fe629..0648450d833 100644 --- a/src/librustc/ty/item_path.rs +++ b/src/librustc/ty/item_path.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use front::map::DefPathData; +use hir::map::DefPathData; use middle::cstore::LOCAL_CRATE; use middle::def_id::{DefId, CRATE_DEF_INDEX}; use ty::{self, Ty, TyCtxt}; diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index edfad09ae1f..69a6a6aa920 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -19,8 +19,8 @@ pub use self::LvaluePreference::*; pub use self::fold::TypeFoldable; use dep_graph::{self, DepNode}; -use front::map as ast_map; -use front::map::LinkedPath; +use hir::map as ast_map; +use hir::map::LinkedPath; use middle; use middle::cstore::{self, CrateStore, LOCAL_CRATE}; use middle::def::{self, Def, ExportMap}; @@ -52,9 +52,9 @@ use syntax::parse::token::InternedString; use rustc_const_math::ConstInt; -use rustc_front::hir; -use rustc_front::hir::{ItemImpl, ItemTrait, PatKind}; -use rustc_front::intravisit::Visitor; +use hir; +use hir::{ItemImpl, ItemTrait, PatKind}; +use hir::intravisit::Visitor; pub use self::sty::{Binder, DebruijnIndex}; pub use self::sty::{BuiltinBound, BuiltinBounds, ExistentialBounds}; diff --git a/src/librustc/ty/relate.rs b/src/librustc/ty/relate.rs index b39cb5ef939..b1bff9b43cc 100644 --- a/src/librustc/ty/relate.rs +++ b/src/librustc/ty/relate.rs @@ -19,7 +19,7 @@ use ty::{self, Ty, TyCtxt, TypeFoldable}; use ty::error::{ExpectedFound, TypeError}; use std::rc::Rc; use syntax::abi; -use rustc_front::hir as ast; +use hir as ast; pub type RelateResult<'tcx, T> = Result>; diff --git a/src/librustc/ty/structural_impls.rs b/src/librustc/ty/structural_impls.rs index 82cc9e7f2e3..bbf6d0329b4 100644 --- a/src/librustc/ty/structural_impls.rs +++ b/src/librustc/ty/structural_impls.rs @@ -17,7 +17,7 @@ use std::rc::Rc; use syntax::abi; use syntax::ptr::P; -use rustc_front::hir; +use hir; /////////////////////////////////////////////////////////////////////////// // Lift implementations diff --git a/src/librustc/ty/sty.rs b/src/librustc/ty/sty.rs index fee0aaff445..101c8501bd3 100644 --- a/src/librustc/ty/sty.rs +++ b/src/librustc/ty/sty.rs @@ -28,7 +28,7 @@ use syntax::parse::token::special_idents; use serialize::{Decodable, Decoder}; -use rustc_front::hir; +use hir; use self::FnOutput::*; use self::InferTy::*; diff --git a/src/librustc/ty/trait_def.rs b/src/librustc/ty/trait_def.rs index 3ebf2ba4c84..0eb70f93bed 100644 --- a/src/librustc/ty/trait_def.rs +++ b/src/librustc/ty/trait_def.rs @@ -17,7 +17,7 @@ use ty::{Ty, TyCtxt, TraitRef}; use std::borrow::{Borrow}; use std::cell::{Cell, Ref, RefCell}; use syntax::ast::Name; -use rustc_front::hir; +use hir; use util::nodemap::FnvHashMap; /// As `TypeScheme` but for a trait ref. diff --git a/src/librustc/ty/util.rs b/src/librustc/ty/util.rs index 6e8363f629b..710cd2e301c 100644 --- a/src/librustc/ty/util.rs +++ b/src/librustc/ty/util.rs @@ -10,7 +10,7 @@ //! misc. type-system utilities too small to deserve their own file -use back::svh::Svh; +use hir::svh::Svh; use middle::def_id::DefId; use ty::subst; use infer; @@ -28,7 +28,7 @@ use syntax::ast::{self, Name}; use syntax::attr::{self, AttrMetaMethods, SignedInt, UnsignedInt}; use syntax::codemap::Span; -use rustc_front::hir; +use hir; pub trait IntTypeExt { fn to_ty<'tcx>(&self, cx: &TyCtxt<'tcx>) -> Ty<'tcx>; diff --git a/src/librustc/util/common.rs b/src/librustc/util/common.rs index 888a623b24a..bdfb97549d5 100644 --- a/src/librustc/util/common.rs +++ b/src/librustc/util/common.rs @@ -19,9 +19,9 @@ use std::iter::repeat; use std::path::Path; use std::time::Instant; -use rustc_front::hir; -use rustc_front::intravisit; -use rustc_front::intravisit::Visitor; +use hir; +use hir::intravisit; +use hir::intravisit::Visitor; // The name of the associated type for `Fn` return types pub const FN_OUTPUT_NAME: &'static str = "Output"; diff --git a/src/librustc/util/ppaux.rs b/src/librustc/util/ppaux.rs index 20f16a1d255..c386a670ba2 100644 --- a/src/librustc/util/ppaux.rs +++ b/src/librustc/util/ppaux.rs @@ -23,7 +23,7 @@ use std::fmt; use syntax::abi::Abi; use syntax::parse::token; use syntax::ast::CRATE_NODE_ID; -use rustc_front::hir; +use hir; pub fn verbose() -> bool { ty::tls::with(|tcx| tcx.sess.verbose()) diff --git a/src/librustc_back/Cargo.toml b/src/librustc_back/Cargo.toml index 2cf6cbc4bcf..85e861b405a 100644 --- a/src/librustc_back/Cargo.toml +++ b/src/librustc_back/Cargo.toml @@ -11,7 +11,6 @@ crate-type = ["dylib"] [dependencies] syntax = { path = "../libsyntax" } serialize = { path = "../libserialize" } -rustc_front = { path = "../librustc_front" } log = { path = "../liblog" } [features] diff --git a/src/librustc_back/lib.rs b/src/librustc_back/lib.rs index 80dec2cd281..25edaf4b8e4 100644 --- a/src/librustc_back/lib.rs +++ b/src/librustc_back/lib.rs @@ -45,13 +45,11 @@ extern crate syntax; extern crate libc; extern crate serialize; -extern crate rustc_front; #[macro_use] extern crate log; pub mod tempdir; pub mod rpath; pub mod sha2; -pub mod svh; pub mod target; pub mod slice; pub mod dynamic_lib; diff --git a/src/librustc_borrowck/Cargo.toml b/src/librustc_borrowck/Cargo.toml index fdb97bd8d2d..6da87f97fb7 100644 --- a/src/librustc_borrowck/Cargo.toml +++ b/src/librustc_borrowck/Cargo.toml @@ -13,5 +13,4 @@ log = { path = "../liblog" } syntax = { path = "../libsyntax" } graphviz = { path = "../libgraphviz" } rustc = { path = "../librustc" } -rustc_front = { path = "../librustc_front" } rustc_mir = { path = "../librustc_mir" } diff --git a/src/librustc_borrowck/borrowck/check_loans.rs b/src/librustc_borrowck/borrowck/check_loans.rs index aa2b7ed2cde..d79ba213aca 100644 --- a/src/librustc_borrowck/borrowck/check_loans.rs +++ b/src/librustc_borrowck/borrowck/check_loans.rs @@ -30,7 +30,7 @@ use rustc::ty::{self, TyCtxt}; use rustc::traits::ProjectionMode; use syntax::ast; use syntax::codemap::Span; -use rustc_front::hir; +use rustc::hir; use std::rc::Rc; diff --git a/src/librustc_borrowck/borrowck/gather_loans/gather_moves.rs b/src/librustc_borrowck/borrowck/gather_loans/gather_moves.rs index 489c8be4e38..c85d69fa8a6 100644 --- a/src/librustc_borrowck/borrowck/gather_loans/gather_moves.rs +++ b/src/librustc_borrowck/borrowck/gather_loans/gather_moves.rs @@ -23,7 +23,7 @@ use rustc::ty; use std::rc::Rc; use syntax::ast; use syntax::codemap::Span; -use rustc_front::hir::{self, PatKind}; +use rustc::hir::{self, PatKind}; struct GatherMoveInfo<'tcx> { id: ast::NodeId, diff --git a/src/librustc_borrowck/borrowck/gather_loans/mod.rs b/src/librustc_borrowck/borrowck/gather_loans/mod.rs index c759722c24b..893c27f0ede 100644 --- a/src/librustc_borrowck/borrowck/gather_loans/mod.rs +++ b/src/librustc_borrowck/borrowck/gather_loans/mod.rs @@ -29,10 +29,10 @@ use rustc::traits::ProjectionMode; use syntax::ast; use syntax::codemap::Span; use syntax::ast::NodeId; -use rustc_front::hir; -use rustc_front::hir::Expr; -use rustc_front::intravisit; -use rustc_front::intravisit::Visitor; +use rustc::hir; +use rustc::hir::Expr; +use rustc::hir::intravisit; +use rustc::hir::intravisit::Visitor; use self::restrictions::RestrictionResult; diff --git a/src/librustc_borrowck/borrowck/gather_loans/move_error.rs b/src/librustc_borrowck/borrowck/gather_loans/move_error.rs index f5e3bc4f6fb..3d94f5b186f 100644 --- a/src/librustc_borrowck/borrowck/gather_loans/move_error.rs +++ b/src/librustc_borrowck/borrowck/gather_loans/move_error.rs @@ -16,7 +16,7 @@ use rustc::ty; use syntax::ast; use syntax::codemap; use syntax::errors::DiagnosticBuilder; -use rustc_front::hir; +use rustc::hir; pub struct MoveErrorCollector<'tcx> { errors: Vec> diff --git a/src/librustc_borrowck/borrowck/mir/mod.rs b/src/librustc_borrowck/borrowck/mir/mod.rs index d1335811858..672faea58f5 100644 --- a/src/librustc_borrowck/borrowck/mir/mod.rs +++ b/src/librustc_borrowck/borrowck/mir/mod.rs @@ -13,8 +13,8 @@ use borrowck::BorrowckCtxt; use syntax::ast; use syntax::codemap::Span; -use rustc_front::hir; -use rustc_front::intravisit::{FnKind}; +use rustc::hir; +use rustc::hir::intravisit::{FnKind}; use rustc::mir::repr::{BasicBlock, BasicBlockData, Mir, Statement, Terminator}; diff --git a/src/librustc_borrowck/borrowck/mod.rs b/src/librustc_borrowck/borrowck/mod.rs index 1dfa4da46aa..fec327f4aa0 100644 --- a/src/librustc_borrowck/borrowck/mod.rs +++ b/src/librustc_borrowck/borrowck/mod.rs @@ -21,8 +21,8 @@ pub use self::MovedValueUseKind::*; use self::InteriorKind::*; use rustc::dep_graph::DepNode; -use rustc::front::map as hir_map; -use rustc::front::map::blocks::FnParts; +use rustc::hir::map as hir_map; +use rustc::hir::map::blocks::FnParts; use rustc::cfg; use rustc::middle::dataflow::DataFlowContext; use rustc::middle::dataflow::BitwiseOperator; @@ -44,11 +44,11 @@ use syntax::attr::AttrMetaMethods; use syntax::codemap::Span; use syntax::errors::DiagnosticBuilder; -use rustc_front::hir; -use rustc_front::hir::{FnDecl, Block}; -use rustc_front::intravisit; -use rustc_front::intravisit::{Visitor, FnKind}; -use rustc_front::util as hir_util; +use rustc::hir; +use rustc::hir::{FnDecl, Block}; +use rustc::hir::intravisit; +use rustc::hir::intravisit::{Visitor, FnKind}; +use rustc::hir::util as hir_util; use rustc::mir::mir_map::MirMap; diff --git a/src/librustc_borrowck/borrowck/move_data.rs b/src/librustc_borrowck/borrowck/move_data.rs index b31f74c6476..292cfcfeac1 100644 --- a/src/librustc_borrowck/borrowck/move_data.rs +++ b/src/librustc_borrowck/borrowck/move_data.rs @@ -30,7 +30,7 @@ use std::usize; use syntax::ast; use syntax::ast_util; use syntax::codemap::Span; -use rustc_front::hir; +use rustc::hir; #[path="fragments.rs"] pub mod fragments; diff --git a/src/librustc_borrowck/lib.rs b/src/librustc_borrowck/lib.rs index 6f21fcd9230..e38677de662 100644 --- a/src/librustc_borrowck/lib.rs +++ b/src/librustc_borrowck/lib.rs @@ -34,7 +34,6 @@ extern crate graphviz as dot; #[macro_use] extern crate rustc; -extern crate rustc_front; extern crate rustc_mir; extern crate core; // for NonZero diff --git a/src/librustc_const_eval/Cargo.toml b/src/librustc_const_eval/Cargo.toml index f38c60cd1fa..c572284a6bb 100644 --- a/src/librustc_const_eval/Cargo.toml +++ b/src/librustc_const_eval/Cargo.toml @@ -12,7 +12,6 @@ crate-type = ["dylib"] log = { path = "../liblog" } serialize = { path = "../libserialize" } rustc = { path = "../librustc" } -rustc_front = { path = "../librustc_front" } rustc_back = { path = "../librustc_back" } rustc_const_math = { path = "../librustc_const_math" } syntax = { path = "../libsyntax" } diff --git a/src/librustc_const_eval/check_match.rs b/src/librustc_const_eval/check_match.rs index a46d72840b7..70781184f74 100644 --- a/src/librustc_const_eval/check_match.rs +++ b/src/librustc_const_eval/check_match.rs @@ -32,17 +32,17 @@ use std::cmp::Ordering; use std::fmt; use std::iter::{FromIterator, IntoIterator, repeat}; -use rustc_front::hir; -use rustc_front::hir::{Pat, PatKind}; -use rustc_front::intravisit::{self, Visitor, FnKind}; -use rustc_front::util as front_util; +use rustc::hir; +use rustc::hir::{Pat, PatKind}; +use rustc::hir::intravisit::{self, Visitor, FnKind}; +use rustc::hir::util as front_util; use rustc_back::slice; use syntax::ast::{self, DUMMY_NODE_ID, NodeId}; use syntax::ast_util; use syntax::codemap::{Span, Spanned, DUMMY_SP}; -use rustc_front::fold::{Folder, noop_fold_pat}; -use rustc_front::print::pprust::pat_to_string; +use rustc::hir::fold::{Folder, noop_fold_pat}; +use rustc::hir::print::pat_to_string; use syntax::ptr::P; use rustc::util::nodemap::FnvHashMap; diff --git a/src/librustc_const_eval/eval.rs b/src/librustc_const_eval/eval.rs index 5a00b4573de..dba31ddef95 100644 --- a/src/librustc_const_eval/eval.rs +++ b/src/librustc_const_eval/eval.rs @@ -15,8 +15,8 @@ use rustc::middle::const_val::ConstVal; use self::ErrKind::*; use self::EvalHint::*; -use rustc::front::map as ast_map; -use rustc::front::map::blocks::FnLikeNode; +use rustc::hir::map as ast_map; +use rustc::hir::map::blocks::FnLikeNode; use rustc::middle::cstore::{self, CrateStore, InlinedItem}; use rustc::{infer, traits}; use rustc::middle::def::Def; @@ -31,9 +31,9 @@ use rustc::lint; use graphviz::IntoCow; use syntax::ast; -use rustc_front::hir::{Expr, PatKind}; -use rustc_front::hir; -use rustc_front::intravisit::FnKind; +use rustc::hir::{Expr, PatKind}; +use rustc::hir; +use rustc::hir::intravisit::FnKind; use syntax::codemap::Span; use syntax::ptr::P; use syntax::codemap; diff --git a/src/librustc_const_eval/lib.rs b/src/librustc_const_eval/lib.rs index b74fc121e39..085888dc21f 100644 --- a/src/librustc_const_eval/lib.rs +++ b/src/librustc_const_eval/lib.rs @@ -33,7 +33,6 @@ #[macro_use] extern crate syntax; #[macro_use] extern crate log; #[macro_use] extern crate rustc; -extern crate rustc_front; extern crate rustc_back; extern crate rustc_const_math; extern crate graphviz; diff --git a/src/librustc_driver/Cargo.toml b/src/librustc_driver/Cargo.toml index 0d2ae14d7d1..bac5900f3ed 100644 --- a/src/librustc_driver/Cargo.toml +++ b/src/librustc_driver/Cargo.toml @@ -17,7 +17,6 @@ rustc = { path = "../librustc" } rustc_back = { path = "../librustc_back" } rustc_borrowck = { path = "../librustc_borrowck" } rustc_const_eval = { path = "../librustc_const_eval" } -rustc_front = { path = "../librustc_front" } rustc_lint = { path = "../librustc_lint" } rustc_llvm = { path = "../librustc_llvm" } rustc_mir = { path = "../librustc_mir" } diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index 4255d4fc8b0..f661b2a38b6 100644 --- a/src/librustc_driver/driver.rs +++ b/src/librustc_driver/driver.rs @@ -9,8 +9,8 @@ // except according to those terms. use rustc::dep_graph::DepGraph; -use rustc::front; -use rustc::front::map as hir_map; +use rustc::hir; +use rustc::hir::map as hir_map; use rustc_mir as mir; use rustc::mir::mir_map::MirMap; use rustc::session::{Session, CompileResult, compile_result_from_err_count}; @@ -35,8 +35,7 @@ use rustc_typeck as typeck; use rustc_privacy; use rustc_plugin::registry::Registry; use rustc_plugin as plugin; -use rustc_front::hir; -use rustc_front::lowering::{lower_crate, LoweringContext}; +use rustc::hir::lowering::{lower_crate, LoweringContext}; use rustc_passes::{no_asm, loops, consts, const_fn, rvalues, static_recursion}; use rustc_const_eval::check_match; use super::Compilation; @@ -155,7 +154,7 @@ pub fn compile_input(sess: &Session, } time(sess.time_passes(), "attribute checking", || { - front::check_attr::check_crate(sess, &expanded_crate); + hir::check_attr::check_crate(sess, &expanded_crate); }); time(sess.time_passes(), diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index 3444b770cc8..b4b53d30e3c 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -42,7 +42,6 @@ extern crate rustc_back; extern crate rustc_borrowck; extern crate rustc_const_eval; extern crate rustc_passes; -extern crate rustc_front; extern crate rustc_lint; extern crate rustc_plugin; extern crate rustc_privacy; diff --git a/src/librustc_driver/pretty.rs b/src/librustc_driver/pretty.rs index 31345cfdc41..cda5595c102 100644 --- a/src/librustc_driver/pretty.rs +++ b/src/librustc_driver/pretty.rs @@ -50,11 +50,11 @@ use std::option; use std::path::PathBuf; use std::str::FromStr; -use rustc::front::map as hir_map; -use rustc::front::map::{blocks, NodePrinter}; -use rustc_front::hir; -use rustc_front::lowering::{lower_crate, LoweringContext}; -use rustc_front::print::pprust as pprust_hir; +use rustc::hir::map as hir_map; +use rustc::hir::map::{blocks, NodePrinter}; +use rustc::hir; +use rustc::hir::lowering::{lower_crate, LoweringContext}; +use rustc::hir::print as pprust_hir; use rustc::mir::mir_map::MirMap; diff --git a/src/librustc_driver/test.rs b/src/librustc_driver/test.rs index ce0d42203b9..fc12d546288 100644 --- a/src/librustc_driver/test.rs +++ b/src/librustc_driver/test.rs @@ -27,7 +27,7 @@ use rustc::ty::{self, Ty, TyCtxt, TypeFoldable}; use rustc::ty::relate::TypeRelation; use rustc::infer::{self, InferOk, InferResult, TypeOrigin}; use rustc_metadata::cstore::CStore; -use rustc::front::map as hir_map; +use rustc::hir::map as hir_map; use rustc::session::{self, config}; use std::rc::Rc; use syntax::ast; @@ -39,8 +39,8 @@ use syntax::errors::{Level, RenderSpan}; use syntax::parse::token; use syntax::feature_gate::UnstableFeatures; -use rustc_front::lowering::{lower_crate, LoweringContext}; -use rustc_front::hir; +use rustc::hir::lowering::{lower_crate, LoweringContext}; +use rustc::hir; struct Env<'a, 'tcx: 'a> { infcx: &'a infer::InferCtxt<'a, 'tcx>, diff --git a/src/librustc_front/Cargo.toml b/src/librustc_front/Cargo.toml deleted file mode 100644 index bf40cdbd330..00000000000 --- a/src/librustc_front/Cargo.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -authors = ["The Rust Project Developers"] -name = "rustc_front" -version = "0.0.0" - -[lib] -name = "rustc_front" -path = "lib.rs" -crate-type = ["dylib"] - -[dependencies] -log = { path = "../liblog" } -syntax = { path = "../libsyntax" } -serialize = { path = "../libserialize" } -rustc_bitflags = { path = "../librustc_bitflags" } diff --git a/src/librustc_front/lib.rs b/src/librustc_front/lib.rs deleted file mode 100644 index b9e3b71cf1a..00000000000 --- a/src/librustc_front/lib.rs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2015 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -//! The Rust compiler. -//! -//! # Note -//! -//! This API is completely unstable and subject to change. - -#![crate_name = "rustc_front"] -#![unstable(feature = "rustc_private", issue = "27812")] -#![crate_type = "dylib"] -#![crate_type = "rlib"] -#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", - html_favicon_url = "https://doc.rust-lang.org/favicon.ico", - html_root_url = "http://doc.rust-lang.org/nightly/")] -#![cfg_attr(not(stage0), deny(warnings))] - -#![feature(associated_consts)] -#![feature(box_patterns)] -#![feature(box_syntax)] -#![feature(const_fn)] -#![feature(quote)] -#![feature(rustc_diagnostic_macros)] -#![feature(rustc_private)] -#![feature(slice_patterns)] -#![feature(staged_api)] -#![feature(str_char)] -#![feature(question_mark)] - -extern crate serialize; -#[macro_use] -extern crate log; -#[macro_use] -extern crate syntax; -#[macro_use] -#[no_link] -extern crate rustc_bitflags; - -extern crate serialize as rustc_serialize; // used by deriving - -#[macro_use] -pub mod hir; -pub mod lowering; -pub mod fold; -pub mod intravisit; -pub mod util; - -pub mod print { - pub mod pprust; -} diff --git a/src/librustc_lint/Cargo.toml b/src/librustc_lint/Cargo.toml index 4821a723279..3f0cd397e76 100644 --- a/src/librustc_lint/Cargo.toml +++ b/src/librustc_lint/Cargo.toml @@ -13,5 +13,4 @@ log = { path = "../liblog" } rustc = { path = "../librustc" } rustc_back = { path = "../librustc_back" } rustc_const_eval = { path = "../librustc_const_eval" } -rustc_front = { path = "../librustc_front" } syntax = { path = "../libsyntax" } diff --git a/src/librustc_lint/bad_style.rs b/src/librustc_lint/bad_style.rs index ca189d0b519..ed9c66a1882 100644 --- a/src/librustc_lint/bad_style.rs +++ b/src/librustc_lint/bad_style.rs @@ -17,8 +17,8 @@ use syntax::ast; use syntax::attr::{self, AttrMetaMethods}; use syntax::codemap::Span; -use rustc_front::hir::{self, PatKind}; -use rustc_front::intravisit::FnKind; +use rustc::hir::{self, PatKind}; +use rustc::hir::intravisit::FnKind; #[derive(PartialEq)] pub enum MethodLateContext { diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index 339c969b01f..6f11ebafa86 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -37,7 +37,7 @@ use rustc::ty::subst::Substs; use rustc::ty::{self, Ty, TyCtxt}; use rustc::ty::adjustment; use rustc::traits::{self, ProjectionMode}; -use rustc::front::map as hir_map; +use rustc::hir::map as hir_map; use util::nodemap::{NodeSet}; use lint::{Level, LateContext, LintContext, LintArray, Lint}; use lint::{LintPass, LateLintPass}; @@ -48,8 +48,8 @@ use syntax::{ast}; use syntax::attr::{self, AttrMetaMethods}; use syntax::codemap::{self, Span}; -use rustc_front::hir::{self, PatKind}; -use rustc_front::intravisit::FnKind; +use rustc::hir::{self, PatKind}; +use rustc::hir::intravisit::FnKind; use bad_style::{MethodLateContext, method_context}; diff --git a/src/librustc_lint/lib.rs b/src/librustc_lint/lib.rs index 0780e4cd048..2075bd5edca 100644 --- a/src/librustc_lint/lib.rs +++ b/src/librustc_lint/lib.rs @@ -44,7 +44,6 @@ extern crate syntax; extern crate rustc; #[macro_use] extern crate log; -extern crate rustc_front; extern crate rustc_back; extern crate rustc_const_eval; diff --git a/src/librustc_lint/types.rs b/src/librustc_lint/types.rs index 6eeadc77698..b094bca8410 100644 --- a/src/librustc_lint/types.rs +++ b/src/librustc_lint/types.rs @@ -29,8 +29,8 @@ use syntax::abi::Abi; use syntax::attr::{self, AttrMetaMethods}; use syntax::codemap::{self, Span}; -use rustc_front::hir; -use rustc_front::util::is_shift_binop; +use rustc::hir; +use rustc::hir::util::is_shift_binop; register_long_diagnostics! { E0519: r##" diff --git a/src/librustc_lint/unused.rs b/src/librustc_lint/unused.rs index 9840cd4256f..f531628601b 100644 --- a/src/librustc_lint/unused.rs +++ b/src/librustc_lint/unused.rs @@ -24,8 +24,8 @@ use syntax::feature_gate::{KNOWN_ATTRIBUTES, AttributeType}; use syntax::ptr::P; use rustc_back::slice; -use rustc_front::hir; -use rustc_front::intravisit::FnKind; +use rustc::hir; +use rustc::hir::intravisit::FnKind; declare_lint! { pub UNUSED_MUT, diff --git a/src/librustc_metadata/Cargo.toml b/src/librustc_metadata/Cargo.toml index 65c2c2d1480..697cbe39c67 100644 --- a/src/librustc_metadata/Cargo.toml +++ b/src/librustc_metadata/Cargo.toml @@ -16,7 +16,6 @@ rustc = { path = "../librustc" } rustc_back = { path = "../librustc_back" } rustc_bitflags = { path = "../librustc_bitflags" } rustc_const_math = { path = "../librustc_const_math" } -rustc_front = { path = "../librustc_front" } rustc_llvm = { path = "../librustc_llvm" } serialize = { path = "../libserialize" } syntax = { path = "../libsyntax" } diff --git a/src/librustc_metadata/astencode.rs b/src/librustc_metadata/astencode.rs index 505619d31d7..98e73f2902b 100644 --- a/src/librustc_metadata/astencode.rs +++ b/src/librustc_metadata/astencode.rs @@ -12,12 +12,12 @@ // FIXME: remove this after snapshot, and Results are handled #![allow(unused_must_use)] -use rustc::front::map as ast_map; +use rustc::hir::map as ast_map; use rustc::session::Session; -use rustc_front::hir; -use rustc_front::fold; -use rustc_front::fold::Folder; +use rustc::hir; +use rustc::hir::fold; +use rustc::hir::fold::Folder; use common as c; use cstore; @@ -55,8 +55,8 @@ use serialize::EncoderHelpers; #[cfg(test)] use std::io::Cursor; #[cfg(test)] use syntax::parse; #[cfg(test)] use syntax::ast::NodeId; -#[cfg(test)] use rustc_front::print::pprust; -#[cfg(test)] use rustc_front::lowering::{lower_item, LoweringContext}; +#[cfg(test)] use rustc::hir::print as pprust; +#[cfg(test)] use rustc::hir::lowering::{lower_item, LoweringContext}; struct DecodeContext<'a, 'b, 'tcx: 'a> { tcx: &'a TyCtxt<'tcx>, @@ -168,7 +168,7 @@ pub fn decode_inlined_item<'tcx>(cdata: &cstore::crate_metadata, copy_item_types(dcx, ii, orig_did); if let InlinedItem::Item(ref i) = *ii { debug!(">>> DECODED ITEM >>>\n{}\n<<< DECODED ITEM <<<", - ::rustc_front::print::pprust::item_to_string(&i)); + ::rustc::hir::print::item_to_string(&i)); } ii diff --git a/src/librustc_metadata/creader.rs b/src/librustc_metadata/creader.rs index edabf43a150..df9072835b9 100644 --- a/src/librustc_metadata/creader.rs +++ b/src/librustc_metadata/creader.rs @@ -17,13 +17,13 @@ use cstore::{self, CStore, CrateSource, MetadataBlob}; use decoder; use loader::{self, CratePaths}; -use rustc::back::svh::Svh; +use rustc::hir::svh::Svh; use rustc::dep_graph::DepNode; use rustc::session::{config, Session}; use rustc::session::search_paths::PathKind; use rustc::middle::cstore::{CrateStore, validate_crate_name, ExternCrate}; use rustc::util::nodemap::FnvHashMap; -use rustc::front::map as hir_map; +use rustc::hir::map as hir_map; use std::cell::{RefCell, Cell}; use std::path::PathBuf; @@ -37,8 +37,8 @@ use syntax::parse; use syntax::attr; use syntax::attr::AttrMetaMethods; use syntax::parse::token::InternedString; -use rustc_front::intravisit::Visitor; -use rustc_front::hir; +use rustc::hir::intravisit::Visitor; +use rustc::hir; use log; pub struct LocalCrateReader<'a, 'b:'a> { diff --git a/src/librustc_metadata/csearch.rs b/src/librustc_metadata/csearch.rs index c11d9865516..c9e661dec51 100644 --- a/src/librustc_metadata/csearch.rs +++ b/src/librustc_metadata/csearch.rs @@ -20,7 +20,7 @@ use middle::lang_items; use rustc::ty::{self, Ty, TyCtxt, VariantKind}; use middle::def_id::{DefId, DefIndex, CRATE_DEF_INDEX}; -use rustc::front::map as hir_map; +use rustc::hir::map as hir_map; use rustc::mir::repr::Mir; use rustc::mir::mir_map::MirMap; use rustc::util::nodemap::{FnvHashMap, NodeMap, NodeSet, DefIdMap}; @@ -31,9 +31,9 @@ use std::path::PathBuf; use syntax::ast; use syntax::attr; use syntax::parse::token; -use rustc_back::svh::Svh; +use rustc::hir::svh::Svh; use rustc_back::target::Target; -use rustc_front::hir; +use rustc::hir; impl<'tcx> CrateStore<'tcx> for cstore::CStore { fn stability(&self, def: DefId) -> Option @@ -552,7 +552,7 @@ impl<'tcx> CrateStore<'tcx> for cstore::CStore { let mut visible_parent_map = self.visible_parent_map.borrow_mut(); if !visible_parent_map.is_empty() { return visible_parent_map; } - use rustc_front::hir; + use rustc::hir; use rustc::middle::cstore::{CrateStore, ChildItem}; use std::collections::vec_deque::VecDeque; use std::collections::hash_map::Entry; diff --git a/src/librustc_metadata/cstore.rs b/src/librustc_metadata/cstore.rs index 5637301724b..3a6cd4d832b 100644 --- a/src/librustc_metadata/cstore.rs +++ b/src/librustc_metadata/cstore.rs @@ -20,7 +20,7 @@ use decoder; use index; use loader; -use rustc::back::svh::Svh; +use rustc::hir::svh::Svh; use rustc::middle::cstore::{ExternCrate}; use rustc::util::nodemap::{FnvHashMap, NodeMap, NodeSet, DefIdMap}; use rustc::middle::def_id::DefId; diff --git a/src/librustc_metadata/decoder.rs b/src/librustc_metadata/decoder.rs index e85fdb05ca8..5aafd015f9a 100644 --- a/src/librustc_metadata/decoder.rs +++ b/src/librustc_metadata/decoder.rs @@ -22,10 +22,10 @@ use index; use tls_context; use tydecode::TyDecoder; -use rustc::back::svh::Svh; -use rustc::front::map as hir_map; +use rustc::hir::svh::Svh; +use rustc::hir::map as hir_map; use rustc::util::nodemap::FnvHashMap; -use rustc_front::hir; +use rustc::hir; use middle::cstore::{LOCAL_CRATE, FoundAst, InlinedItem, LinkagePreference}; use middle::cstore::{DefLike, DlDef, DlField, DlImpl, tls}; diff --git a/src/librustc_metadata/encoder.rs b/src/librustc_metadata/encoder.rs index 30eabb7e8f3..dc21ebcbcfc 100644 --- a/src/librustc_metadata/encoder.rs +++ b/src/librustc_metadata/encoder.rs @@ -30,9 +30,9 @@ use rustc::traits::specialization_graph; use rustc::ty::{self, Ty, TyCtxt}; use rustc::ty::util::IntTypeExt; -use rustc::back::svh::Svh; -use rustc::front::map::{LinkedPath, PathElem, PathElems}; -use rustc::front::map as ast_map; +use rustc::hir::svh::Svh; +use rustc::hir::map::{LinkedPath, PathElem, PathElems}; +use rustc::hir::map as ast_map; use rustc::mir::mir_map::MirMap; use rustc::session::config; use rustc::util::nodemap::{FnvHashMap, NodeMap, NodeSet}; @@ -52,9 +52,9 @@ use syntax::errors::Handler; use syntax; use rbml::writer::Encoder; -use rustc_front::hir::{self, PatKind}; -use rustc_front::intravisit::Visitor; -use rustc_front::intravisit; +use rustc::hir::{self, PatKind}; +use rustc::hir::intravisit::Visitor; +use rustc::hir::intravisit; pub struct EncodeContext<'a, 'tcx: 'a> { pub diag: &'a Handler, diff --git a/src/librustc_metadata/lib.rs b/src/librustc_metadata/lib.rs index c927f53eccd..139462d41bf 100644 --- a/src/librustc_metadata/lib.rs +++ b/src/librustc_metadata/lib.rs @@ -36,7 +36,6 @@ extern crate serialize; #[macro_use] extern crate rustc; extern crate rustc_back; -extern crate rustc_front; extern crate rustc_llvm; extern crate rustc_const_math; diff --git a/src/librustc_metadata/loader.rs b/src/librustc_metadata/loader.rs index 87e86e221f1..c7cd8ae2dd7 100644 --- a/src/librustc_metadata/loader.rs +++ b/src/librustc_metadata/loader.rs @@ -216,7 +216,7 @@ use cstore::{MetadataBlob, MetadataVec, MetadataArchive}; use decoder; use encoder; -use rustc::back::svh::Svh; +use rustc::hir::svh::Svh; use rustc::session::Session; use rustc::session::filesearch::{FileSearch, FileMatches, FileDoesntMatch}; use rustc::session::search_paths::PathKind; diff --git a/src/librustc_metadata/tydecode.rs b/src/librustc_metadata/tydecode.rs index 28985c75a91..cd63b58372b 100644 --- a/src/librustc_metadata/tydecode.rs +++ b/src/librustc_metadata/tydecode.rs @@ -16,7 +16,7 @@ #![allow(non_camel_case_types)] -use rustc_front::hir; +use rustc::hir; use middle::def_id::{DefId, DefIndex}; use middle::region; diff --git a/src/librustc_metadata/tyencode.rs b/src/librustc_metadata/tyencode.rs index ffaf7e2d465..b5079256487 100644 --- a/src/librustc_metadata/tyencode.rs +++ b/src/librustc_metadata/tyencode.rs @@ -25,7 +25,7 @@ use rustc::ty::ParamTy; use rustc::ty::{self, Ty, TyCtxt}; use rustc::util::nodemap::FnvHashMap; -use rustc_front::hir; +use rustc::hir; use syntax::abi::Abi; use syntax::ast; diff --git a/src/librustc_mir/Cargo.toml b/src/librustc_mir/Cargo.toml index f136618b1c9..1c41ca6f416 100644 --- a/src/librustc_mir/Cargo.toml +++ b/src/librustc_mir/Cargo.toml @@ -16,5 +16,4 @@ rustc_back = { path = "../librustc_back" } rustc_const_eval = { path = "../librustc_const_eval" } rustc_const_math = { path = "../librustc_const_math" } rustc_data_structures = { path = "../librustc_data_structures" } -rustc_front = { path = "../librustc_front" } syntax = { path = "../libsyntax" } diff --git a/src/librustc_mir/build/block.rs b/src/librustc_mir/build/block.rs index ef48a408e79..8c98408e239 100644 --- a/src/librustc_mir/build/block.rs +++ b/src/librustc_mir/build/block.rs @@ -11,7 +11,7 @@ use build::{BlockAnd, BlockAndExtension, Builder}; use hair::*; use rustc::mir::repr::*; -use rustc_front::hir; +use rustc::hir; impl<'a,'tcx> Builder<'a,'tcx> { pub fn ast_block(&mut self, diff --git a/src/librustc_mir/build/mod.rs b/src/librustc_mir/build/mod.rs index 51069c38857..2e5b6a952b7 100644 --- a/src/librustc_mir/build/mod.rs +++ b/src/librustc_mir/build/mod.rs @@ -13,7 +13,7 @@ use rustc::middle::region::{CodeExtent, CodeExtentData}; use rustc::ty::{FnOutput, Ty}; use rustc::mir::repr::*; use rustc_data_structures::fnv::FnvHashMap; -use rustc_front::hir; +use rustc::hir; use std::ops::{Index, IndexMut}; use syntax::ast; use syntax::codemap::Span; diff --git a/src/librustc_mir/hair/cx/block.rs b/src/librustc_mir/hair/cx/block.rs index c7af42b776f..f0ed25902f7 100644 --- a/src/librustc_mir/hair/cx/block.rs +++ b/src/librustc_mir/hair/cx/block.rs @@ -12,7 +12,7 @@ use hair::*; use hair::cx::Cx; use hair::cx::to_ref::ToRef; use rustc::middle::region::{BlockRemainder, CodeExtentData}; -use rustc_front::hir; +use rustc::hir; use syntax::ast; impl<'tcx> Mirror<'tcx> for &'tcx hir::Block { diff --git a/src/librustc_mir/hair/cx/expr.rs b/src/librustc_mir/hair/cx/expr.rs index 7e16883e754..475ae459fef 100644 --- a/src/librustc_mir/hair/cx/expr.rs +++ b/src/librustc_mir/hair/cx/expr.rs @@ -14,7 +14,7 @@ use rustc_const_math::ConstInt; use hair::cx::Cx; use hair::cx::block; use hair::cx::to_ref::ToRef; -use rustc::front::map; +use rustc::hir::map; use rustc::middle::def::Def; use rustc::middle::const_val::ConstVal; use rustc_const_eval as const_eval; @@ -22,8 +22,8 @@ use rustc::middle::region::CodeExtent; use rustc::middle::pat_util; use rustc::ty::{self, VariantDef, Ty}; use rustc::mir::repr::*; -use rustc_front::hir; -use rustc_front::util as hir_util; +use rustc::hir; +use rustc::hir::util as hir_util; use syntax::ptr::P; impl<'tcx> Mirror<'tcx> for &'tcx hir::Expr { diff --git a/src/librustc_mir/hair/cx/mod.rs b/src/librustc_mir/hair/cx/mod.rs index 05448a7deab..f0c6887802d 100644 --- a/src/librustc_mir/hair/cx/mod.rs +++ b/src/librustc_mir/hair/cx/mod.rs @@ -25,7 +25,7 @@ use rustc::infer::InferCtxt; use rustc::ty::subst::{Subst, Substs}; use rustc::ty::{self, Ty, TyCtxt}; use syntax::parse::token; -use rustc_front::hir; +use rustc::hir; use rustc_const_math::{ConstInt, ConstUsize}; #[derive(Copy, Clone)] diff --git a/src/librustc_mir/hair/cx/pattern.rs b/src/librustc_mir/hair/cx/pattern.rs index 8ec8cd4bf81..673d12c3316 100644 --- a/src/librustc_mir/hair/cx/pattern.rs +++ b/src/librustc_mir/hair/cx/pattern.rs @@ -16,7 +16,7 @@ use rustc::middle::def::Def; use rustc::middle::pat_util::{pat_is_resolved_const, pat_is_binding}; use rustc::ty::{self, Ty}; use rustc::mir::repr::*; -use rustc_front::hir::{self, PatKind}; +use rustc::hir::{self, PatKind}; use syntax::ast; use syntax::codemap::Span; use syntax::ptr::P; diff --git a/src/librustc_mir/hair/cx/to_ref.rs b/src/librustc_mir/hair/cx/to_ref.rs index 24fcc2f4fcd..63dbde47438 100644 --- a/src/librustc_mir/hair/cx/to_ref.rs +++ b/src/librustc_mir/hair/cx/to_ref.rs @@ -10,7 +10,7 @@ use hair::*; -use rustc_front::hir; +use rustc::hir; use syntax::ptr::P; pub trait ToRef { diff --git a/src/librustc_mir/hair/mod.rs b/src/librustc_mir/hair/mod.rs index affc1872987..0ea8dece47c 100644 --- a/src/librustc_mir/hair/mod.rs +++ b/src/librustc_mir/hair/mod.rs @@ -21,7 +21,7 @@ use rustc::middle::def_id::DefId; use rustc::middle::region::CodeExtent; use rustc::ty::subst::Substs; use rustc::ty::{self, AdtDef, ClosureSubsts, Region, Ty}; -use rustc_front::hir; +use rustc::hir; use syntax::ast; use syntax::codemap::Span; use self::cx::Cx; diff --git a/src/librustc_mir/lib.rs b/src/librustc_mir/lib.rs index dd81895ebec..ced73f34e0d 100644 --- a/src/librustc_mir/lib.rs +++ b/src/librustc_mir/lib.rs @@ -30,7 +30,6 @@ extern crate graphviz as dot; #[macro_use] extern crate rustc; extern crate rustc_data_structures; -extern crate rustc_front; extern crate rustc_back; extern crate syntax; extern crate rustc_const_math; diff --git a/src/librustc_mir/mir_map.rs b/src/librustc_mir/mir_map.rs index 9ec88c1b59a..40334f652ee 100644 --- a/src/librustc_mir/mir_map.rs +++ b/src/librustc_mir/mir_map.rs @@ -17,7 +17,6 @@ //! - `#[rustc_mir(pretty="file.mir")]` extern crate syntax; -extern crate rustc_front; use build; use rustc::dep_graph::DepNode; @@ -31,8 +30,8 @@ use rustc::traits::ProjectionMode; use rustc::ty::{self, Ty, TyCtxt}; use rustc::util::common::ErrorReported; use rustc::util::nodemap::NodeMap; -use rustc_front::hir; -use rustc_front::intravisit::{self, Visitor}; +use rustc::hir; +use rustc::hir::intravisit::{self, Visitor}; use syntax::abi::Abi; use syntax::ast; use syntax::attr::AttrMetaMethods; diff --git a/src/librustc_passes/Cargo.toml b/src/librustc_passes/Cargo.toml index 02303aa7130..fa6bd3dfb67 100644 --- a/src/librustc_passes/Cargo.toml +++ b/src/librustc_passes/Cargo.toml @@ -12,5 +12,4 @@ crate-type = ["dylib"] log = { path = "../liblog" } rustc = { path = "../librustc" } rustc_const_eval = { path = "../librustc_const_eval" } -rustc_front = { path = "../librustc_front" } syntax = { path = "../libsyntax" } diff --git a/src/librustc_passes/consts.rs b/src/librustc_passes/consts.rs index ba5d8ef45b6..38784191a78 100644 --- a/src/librustc_passes/consts.rs +++ b/src/librustc_passes/consts.rs @@ -42,11 +42,11 @@ use rustc::util::nodemap::NodeMap; use rustc::middle::const_qualif::ConstQualif; use rustc::lint::builtin::CONST_ERR; -use rustc_front::hir::{self, PatKind}; +use rustc::hir::{self, PatKind}; use syntax::ast; use syntax::codemap::Span; use syntax::feature_gate::UnstableFeatures; -use rustc_front::intravisit::{self, FnKind, Visitor}; +use rustc::hir::intravisit::{self, FnKind, Visitor}; use std::collections::hash_map::Entry; use std::cmp::Ordering; diff --git a/src/librustc_passes/lib.rs b/src/librustc_passes/lib.rs index 44bcdcdb364..53ae1b30f7c 100644 --- a/src/librustc_passes/lib.rs +++ b/src/librustc_passes/lib.rs @@ -29,7 +29,6 @@ extern crate core; #[macro_use] extern crate rustc; -extern crate rustc_front; extern crate rustc_const_eval; #[macro_use] extern crate log; diff --git a/src/librustc_passes/loops.rs b/src/librustc_passes/loops.rs index a89627aea82..9a58a704c52 100644 --- a/src/librustc_passes/loops.rs +++ b/src/librustc_passes/loops.rs @@ -12,9 +12,9 @@ use self::Context::*; use rustc::session::Session; use rustc::dep_graph::DepNode; -use rustc::front::map::Map; -use rustc_front::intravisit::{self, Visitor}; -use rustc_front::hir; +use rustc::hir::map::Map; +use rustc::hir::intravisit::{self, Visitor}; +use rustc::hir; use syntax::codemap::Span; #[derive(Clone, Copy, PartialEq)] diff --git a/src/librustc_passes/rvalues.rs b/src/librustc_passes/rvalues.rs index 98502f5a16e..754d5ef8f52 100644 --- a/src/librustc_passes/rvalues.rs +++ b/src/librustc_passes/rvalues.rs @@ -18,8 +18,8 @@ use rustc::middle::mem_categorization as mc; use rustc::ty::{self, TyCtxt, ParameterEnvironment}; use rustc::traits::ProjectionMode; -use rustc_front::hir; -use rustc_front::intravisit; +use rustc::hir; +use rustc::hir::intravisit; use syntax::ast; use syntax::codemap::Span; diff --git a/src/librustc_passes/static_recursion.rs b/src/librustc_passes/static_recursion.rs index 2230283c977..2766d13d7b8 100644 --- a/src/librustc_passes/static_recursion.rs +++ b/src/librustc_passes/static_recursion.rs @@ -12,7 +12,7 @@ // recursively. use rustc::dep_graph::DepNode; -use rustc::front::map as ast_map; +use rustc::hir::map as ast_map; use rustc::session::{Session, CompileResult}; use rustc::middle::def::{Def, DefMap}; use rustc::util::nodemap::NodeMap; @@ -20,8 +20,8 @@ use rustc::util::nodemap::NodeMap; use syntax::{ast}; use syntax::codemap::Span; use syntax::feature_gate::{GateIssue, emit_feature_err}; -use rustc_front::intravisit::{self, Visitor}; -use rustc_front::hir; +use rustc::hir::intravisit::{self, Visitor}; +use rustc::hir; use std::cell::RefCell; diff --git a/src/librustc_plugin/Cargo.toml b/src/librustc_plugin/Cargo.toml index 89fa0df0306..e9a32e53a9f 100644 --- a/src/librustc_plugin/Cargo.toml +++ b/src/librustc_plugin/Cargo.toml @@ -13,7 +13,6 @@ log = { path = "../liblog" } rustc = { path = "../librustc" } rustc_back = { path = "../librustc_back" } rustc_bitflags = { path = "../librustc_bitflags" } -rustc_front = { path = "../librustc_front" } rustc_metadata = { path = "../librustc_metadata" } rustc_mir = { path = "../librustc_mir" } syntax = { path = "../libsyntax" } diff --git a/src/librustc_plugin/build.rs b/src/librustc_plugin/build.rs index fe83b609334..4c7755b1b09 100644 --- a/src/librustc_plugin/build.rs +++ b/src/librustc_plugin/build.rs @@ -15,9 +15,9 @@ use syntax::attr; use syntax::codemap::Span; use syntax::errors; use rustc::dep_graph::DepNode; -use rustc::front::map::Map; -use rustc_front::intravisit::Visitor; -use rustc_front::hir; +use rustc::hir::map::Map; +use rustc::hir::intravisit::Visitor; +use rustc::hir; struct RegistrarFinder { registrars: Vec<(ast::NodeId, Span)> , diff --git a/src/librustc_plugin/lib.rs b/src/librustc_plugin/lib.rs index 8de26083910..5fa29771c57 100644 --- a/src/librustc_plugin/lib.rs +++ b/src/librustc_plugin/lib.rs @@ -69,7 +69,6 @@ extern crate rustc; extern crate rustc_back; -extern crate rustc_front; extern crate rustc_metadata; extern crate rustc_mir; diff --git a/src/librustc_privacy/Cargo.toml b/src/librustc_privacy/Cargo.toml index 56d6ca5543a..0553e54e3aa 100644 --- a/src/librustc_privacy/Cargo.toml +++ b/src/librustc_privacy/Cargo.toml @@ -11,5 +11,4 @@ crate-type = ["dylib"] [dependencies] log = { path = "../liblog" } rustc = { path = "../librustc" } -rustc_front = { path = "../librustc_front" } syntax = { path = "../libsyntax" } diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs index 80df21e85f6..908a7869c42 100644 --- a/src/librustc_privacy/lib.rs +++ b/src/librustc_privacy/lib.rs @@ -25,13 +25,12 @@ #[macro_use] extern crate syntax; #[macro_use] extern crate rustc; -extern crate rustc_front; use std::cmp; use std::mem::replace; -use rustc_front::hir::{self, PatKind}; -use rustc_front::intravisit::{self, Visitor}; +use rustc::hir::{self, PatKind}; +use rustc::hir::intravisit::{self, Visitor}; use rustc::dep_graph::DepNode; use rustc::lint; @@ -41,7 +40,7 @@ use rustc::middle::def_id::DefId; use rustc::middle::privacy::{AccessLevel, AccessLevels}; use rustc::ty::{self, TyCtxt}; use rustc::util::nodemap::NodeSet; -use rustc::front::map as ast_map; +use rustc::hir::map as ast_map; use syntax::ast; use syntax::codemap::Span; diff --git a/src/librustc_resolve/Cargo.toml b/src/librustc_resolve/Cargo.toml index 82e952d2bee..cf477c2a956 100644 --- a/src/librustc_resolve/Cargo.toml +++ b/src/librustc_resolve/Cargo.toml @@ -13,5 +13,4 @@ log = { path = "../liblog" } syntax = { path = "../libsyntax" } rustc = { path = "../librustc" } rustc_bitflags = { path = "../librustc_bitflags" } -rustc_front = { path = "../librustc_front" } arena = { path = "../libarena" } diff --git a/src/librustc_resolve/build_reduced_graph.rs b/src/librustc_resolve/build_reduced_graph.rs index f36a8269dc0..470fd88025e 100644 --- a/src/librustc_resolve/build_reduced_graph.rs +++ b/src/librustc_resolve/build_reduced_graph.rs @@ -33,15 +33,15 @@ use syntax::attr::AttrMetaMethods; use syntax::parse::token::{special_idents, SELF_KEYWORD_NAME, SUPER_KEYWORD_NAME}; use syntax::codemap::{Span, DUMMY_SP}; -use rustc_front::hir; -use rustc_front::hir::{Block, DeclItem}; -use rustc_front::hir::{ForeignItem, ForeignItemFn, ForeignItemStatic}; -use rustc_front::hir::{Item, ItemConst, ItemEnum, ItemExternCrate, ItemFn}; -use rustc_front::hir::{ItemForeignMod, ItemImpl, ItemMod, ItemStatic, ItemDefaultImpl}; -use rustc_front::hir::{ItemStruct, ItemTrait, ItemTy, ItemUse}; -use rustc_front::hir::{PathListIdent, PathListMod, StmtDecl}; -use rustc_front::hir::{Variant, ViewPathGlob, ViewPathList, ViewPathSimple}; -use rustc_front::intravisit::{self, Visitor}; +use rustc::hir; +use rustc::hir::{Block, DeclItem}; +use rustc::hir::{ForeignItem, ForeignItemFn, ForeignItemStatic}; +use rustc::hir::{Item, ItemConst, ItemEnum, ItemExternCrate, ItemFn}; +use rustc::hir::{ItemForeignMod, ItemImpl, ItemMod, ItemStatic, ItemDefaultImpl}; +use rustc::hir::{ItemStruct, ItemTrait, ItemTy, ItemUse}; +use rustc::hir::{PathListIdent, PathListMod, StmtDecl}; +use rustc::hir::{Variant, ViewPathGlob, ViewPathList, ViewPathSimple}; +use rustc::hir::intravisit::{self, Visitor}; trait ToNameBinding<'a> { fn to_name_binding(self) -> NameBinding<'a>; diff --git a/src/librustc_resolve/check_unused.rs b/src/librustc_resolve/check_unused.rs index ea197109cab..4046c8c7783 100644 --- a/src/librustc_resolve/check_unused.rs +++ b/src/librustc_resolve/check_unused.rs @@ -26,9 +26,9 @@ use rustc::lint; use syntax::ast; use syntax::codemap::{Span, DUMMY_SP}; -use rustc_front::hir; -use rustc_front::hir::{ViewPathGlob, ViewPathList, ViewPathSimple}; -use rustc_front::intravisit::Visitor; +use rustc::hir; +use rustc::hir::{ViewPathGlob, ViewPathList, ViewPathSimple}; +use rustc::hir::intravisit::Visitor; struct UnusedImportCheckVisitor<'a, 'b: 'a, 'tcx: 'b> { resolver: &'a mut Resolver<'b, 'tcx>, diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index 98e40d73133..bbf8796436e 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -31,7 +31,6 @@ extern crate arena; #[macro_use] #[no_link] extern crate rustc_bitflags; -extern crate rustc_front; #[macro_use] extern crate rustc; @@ -49,7 +48,7 @@ use self::ParentLink::*; use self::FallbackChecks::*; use rustc::dep_graph::DepNode; -use rustc::front::map as hir_map; +use rustc::hir::map as hir_map; use rustc::session::Session; use rustc::lint; use rustc::middle::cstore::CrateStore; @@ -68,24 +67,24 @@ use syntax::errors::DiagnosticBuilder; use syntax::parse::token::{self, special_names, special_idents}; use syntax::util::lev_distance::find_best_match_for_name; -use rustc_front::intravisit::{self, FnKind, Visitor}; -use rustc_front::hir; -use rustc_front::hir::{Arm, BindByRef, BindByValue, BindingMode, Block}; -use rustc_front::hir::Crate; -use rustc_front::hir::{Expr, ExprAgain, ExprBreak, ExprCall, ExprField}; -use rustc_front::hir::{ExprLoop, ExprWhile, ExprMethodCall}; -use rustc_front::hir::{ExprPath, ExprStruct, FnDecl}; -use rustc_front::hir::{ForeignItemFn, ForeignItemStatic, Generics}; -use rustc_front::hir::{ImplItem, Item, ItemConst, ItemEnum, ItemExternCrate}; -use rustc_front::hir::{ItemFn, ItemForeignMod, ItemImpl, ItemMod, ItemStatic, ItemDefaultImpl}; -use rustc_front::hir::{ItemStruct, ItemTrait, ItemTy, ItemUse}; -use rustc_front::hir::Local; -use rustc_front::hir::{Pat, PatKind, Path, PrimTy}; -use rustc_front::hir::{PathSegment, PathParameters}; -use rustc_front::hir::HirVec; -use rustc_front::hir::{TraitRef, Ty, TyBool, TyChar, TyFloat, TyInt}; -use rustc_front::hir::{TyRptr, TyStr, TyUint, TyPath, TyPtr}; -use rustc_front::util::walk_pat; +use rustc::hir::intravisit::{self, FnKind, Visitor}; +use rustc::hir; +use rustc::hir::{Arm, BindByRef, BindByValue, BindingMode, Block}; +use rustc::hir::Crate; +use rustc::hir::{Expr, ExprAgain, ExprBreak, ExprCall, ExprField}; +use rustc::hir::{ExprLoop, ExprWhile, ExprMethodCall}; +use rustc::hir::{ExprPath, ExprStruct, FnDecl}; +use rustc::hir::{ForeignItemFn, ForeignItemStatic, Generics}; +use rustc::hir::{ImplItem, Item, ItemConst, ItemEnum, ItemExternCrate}; +use rustc::hir::{ItemFn, ItemForeignMod, ItemImpl, ItemMod, ItemStatic, ItemDefaultImpl}; +use rustc::hir::{ItemStruct, ItemTrait, ItemTy, ItemUse}; +use rustc::hir::Local; +use rustc::hir::{Pat, PatKind, Path, PrimTy}; +use rustc::hir::{PathSegment, PathParameters}; +use rustc::hir::HirVec; +use rustc::hir::{TraitRef, Ty, TyBool, TyChar, TyFloat, TyInt}; +use rustc::hir::{TyRptr, TyStr, TyUint, TyPath, TyPtr}; +use rustc::hir::util::walk_pat; use std::collections::{HashMap, HashSet}; use std::cell::{Cell, RefCell}; diff --git a/src/librustc_save_analysis/Cargo.toml b/src/librustc_save_analysis/Cargo.toml index a0cf70b57a9..52fa9193472 100644 --- a/src/librustc_save_analysis/Cargo.toml +++ b/src/librustc_save_analysis/Cargo.toml @@ -11,5 +11,4 @@ crate-type = ["dylib"] [dependencies] log = { path = "../liblog" } rustc = { path = "../librustc" } -rustc_front = { path = "../librustc_front" } syntax = { path = "../libsyntax" } diff --git a/src/librustc_save_analysis/dump_visitor.rs b/src/librustc_save_analysis/dump_visitor.rs index 35ca2a9b014..310747c8991 100644 --- a/src/librustc_save_analysis/dump_visitor.rs +++ b/src/librustc_save_analysis/dump_visitor.rs @@ -42,7 +42,7 @@ use syntax::visit::{self, Visitor}; use syntax::print::pprust::{path_to_string, ty_to_string}; use syntax::ptr::P; -use rustc_front::lowering::{lower_expr, LoweringContext}; +use rustc::hir::lowering::{lower_expr, LoweringContext}; use super::{escape, generated_code, SaveContext, PathCollector}; use super::data::*; diff --git a/src/librustc_save_analysis/lib.rs b/src/librustc_save_analysis/lib.rs index 36b94731e45..e65bf5be256 100644 --- a/src/librustc_save_analysis/lib.rs +++ b/src/librustc_save_analysis/lib.rs @@ -23,13 +23,12 @@ #![feature(staged_api)] #[macro_use] extern crate rustc; -extern crate rustc_front; #[macro_use] extern crate log; #[macro_use] extern crate syntax; -use rustc_front::{hir, lowering}; -use rustc::front::map::NodeItem; +use rustc::hir::{self, lowering}; +use rustc::hir::map::NodeItem; use rustc::middle::def::Def; use rustc::middle::def_id::DefId; use rustc::session::config::CrateType::CrateTypeExecutable; @@ -278,7 +277,7 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> { match item.node { hir::ItemImpl(_, _, _, _, ref ty, _) => { let mut result = String::from("<"); - result.push_str(&rustc_front::print::pprust::ty_to_string(&ty)); + result.push_str(&rustc::hir::print::ty_to_string(&ty)); match self.tcx.trait_of_item(self.tcx.map.local_def_id(id)) { Some(def_id) => { diff --git a/src/librustc_trans/Cargo.toml b/src/librustc_trans/Cargo.toml index fb5a8e4a90e..ea4cef03b70 100644 --- a/src/librustc_trans/Cargo.toml +++ b/src/librustc_trans/Cargo.toml @@ -18,7 +18,6 @@ rustc_back = { path = "../librustc_back" } rustc_const_eval = { path = "../librustc_const_eval" } rustc_const_math = { path = "../librustc_const_math" } rustc_data_structures = { path = "../librustc_data_structures" } -rustc_front = { path = "../librustc_front" } rustc_llvm = { path = "../librustc_llvm" } rustc_mir = { path = "../librustc_mir" } rustc_platform_intrinsics = { path = "../librustc_platform_intrinsics" } diff --git a/src/librustc_trans/_match.rs b/src/librustc_trans/_match.rs index b27929c80c2..3bbead9847b 100644 --- a/src/librustc_trans/_match.rs +++ b/src/librustc_trans/_match.rs @@ -229,10 +229,10 @@ use std::cell::RefCell; use std::cmp::Ordering; use std::fmt; use std::rc::Rc; -use rustc_front::hir::{self, PatKind}; +use rustc::hir::{self, PatKind}; use syntax::ast::{self, DUMMY_NODE_ID, NodeId}; use syntax::codemap::Span; -use rustc_front::fold::Folder; +use rustc::hir::fold::Folder; use syntax::ptr::P; #[derive(Copy, Clone, Debug)] diff --git a/src/librustc_trans/abi.rs b/src/librustc_trans/abi.rs index 6edc26c7009..961a32170d0 100644 --- a/src/librustc_trans/abi.rs +++ b/src/librustc_trans/abi.rs @@ -26,7 +26,7 @@ use machine::{llalign_of_min, llsize_of, llsize_of_real}; use type_::Type; use type_of; -use rustc_front::hir; +use rustc::hir; use rustc::ty::{self, Ty}; use libc::c_uint; diff --git a/src/librustc_trans/asm.rs b/src/librustc_trans/asm.rs index 41f1f4ae5f8..e27bec68375 100644 --- a/src/librustc_trans/asm.rs +++ b/src/librustc_trans/asm.rs @@ -18,7 +18,7 @@ use datum::{Datum, Lvalue}; use type_of; use type_::Type; -use rustc_front::hir as ast; +use rustc::hir as ast; use std::ffi::CString; use syntax::ast::AsmDialect; use libc::{c_uint, c_char}; diff --git a/src/librustc_trans/assert_dep_graph.rs b/src/librustc_trans/assert_dep_graph.rs index bd98b3950d4..ecbb5049443 100644 --- a/src/librustc_trans/assert_dep_graph.rs +++ b/src/librustc_trans/assert_dep_graph.rs @@ -43,8 +43,8 @@ use rustc::middle::def_id::DefId; use rustc::ty::TyCtxt; use rustc_data_structures::fnv::{FnvHashMap, FnvHashSet}; use rustc_data_structures::graph::{Direction, INCOMING, OUTGOING, NodeIndex}; -use rustc_front::hir; -use rustc_front::intravisit::Visitor; +use rustc::hir; +use rustc::hir::intravisit::Visitor; use graphviz::IntoCow; use std::env; use std::fs::File; diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs index 7aef1d912ec..130499603e7 100644 --- a/src/librustc_trans/back/link.rs +++ b/src/librustc_trans/back/link.rs @@ -43,7 +43,7 @@ use syntax::ast; use syntax::codemap::Span; use syntax::attr::AttrMetaMethods; -use rustc_front::hir; +use rustc::hir; // RLIB LLVM-BYTECODE OBJECT LAYOUT // Version 1 diff --git a/src/librustc_trans/back/symbol_names.rs b/src/librustc_trans/back/symbol_names.rs index a458307da40..949a10297c1 100644 --- a/src/librustc_trans/back/symbol_names.rs +++ b/src/librustc_trans/back/symbol_names.rs @@ -105,7 +105,7 @@ use rustc::middle::cstore; use rustc::middle::def_id::DefId; use rustc::ty::{self, TypeFoldable}; use rustc::ty::item_path::{ItemPathBuffer, RootMode}; -use rustc::front::map::definitions::{DefPath, DefPathData}; +use rustc::hir::map::definitions::{DefPath, DefPathData}; use std::fmt::Write; use syntax::parse::token::{self, InternedString}; diff --git a/src/librustc_trans/base.rs b/src/librustc_trans/base.rs index e5667e06b44..d2fc20fd837 100644 --- a/src/librustc_trans/base.rs +++ b/src/librustc_trans/base.rs @@ -46,7 +46,7 @@ use rustc::traits; use rustc::ty::{self, Ty, TyCtxt, TypeFoldable}; use rustc::ty::adjustment::CustomCoerceUnsized; use rustc::dep_graph::DepNode; -use rustc::front::map as hir_map; +use rustc::hir::map as hir_map; use rustc::util::common::time; use rustc::mir::mir_map::MirMap; use session::config::{self, NoDebugInfo, FullDebugInfo}; @@ -106,9 +106,8 @@ use syntax::codemap::{Span, DUMMY_SP}; use syntax::parse::token::InternedString; use syntax::attr::AttrMetaMethods; use syntax::attr; -use rustc_front; -use rustc_front::intravisit::{self, Visitor}; -use rustc_front::hir; +use rustc::hir::intravisit::{self, Visitor}; +use rustc::hir; use syntax::ast; thread_local! { @@ -713,7 +712,7 @@ fn cast_shift_rhs(op: hir::BinOp_, G: FnOnce(ValueRef, Type) -> ValueRef { // Shifts may have any size int on the rhs - if rustc_front::util::is_shift_binop(op) { + if hir::util::is_shift_binop(op) { let mut rhs_llty = val_ty(rhs); let mut lhs_llty = val_ty(lhs); if rhs_llty.kind() == Vector { diff --git a/src/librustc_trans/callee.rs b/src/librustc_trans/callee.rs index 6b0945b2bb2..2da9acf3250 100644 --- a/src/librustc_trans/callee.rs +++ b/src/librustc_trans/callee.rs @@ -26,7 +26,7 @@ use rustc::infer; use rustc::ty::subst; use rustc::ty::subst::{Substs}; use rustc::traits; -use rustc::front::map as hir_map; +use rustc::hir::map as hir_map; use abi::{Abi, FnType}; use adt; use attributes; @@ -54,7 +54,7 @@ use type_of; use value::Value; use Disr; use rustc::ty::{self, Ty, TyCtxt, TypeFoldable}; -use rustc_front::hir; +use rustc::hir; use syntax::codemap::DUMMY_SP; use syntax::errors; diff --git a/src/librustc_trans/closure.rs b/src/librustc_trans/closure.rs index cb94c9dfeb8..579848919ec 100644 --- a/src/librustc_trans/closure.rs +++ b/src/librustc_trans/closure.rs @@ -35,7 +35,7 @@ use session::config::FullDebugInfo; use syntax::ast; -use rustc_front::hir; +use rustc::hir; use libc::c_uint; diff --git a/src/librustc_trans/collector.rs b/src/librustc_trans/collector.rs index 1c18f3ca393..4f197dbee13 100644 --- a/src/librustc_trans/collector.rs +++ b/src/librustc_trans/collector.rs @@ -188,10 +188,10 @@ //! this is not implemented however: a translation item will be produced //! regardless of whether it is actually needed or not. -use rustc_front::hir; -use rustc_front::intravisit as hir_visit; +use rustc::hir; +use rustc::hir::intravisit as hir_visit; -use rustc::front::map as hir_map; +use rustc::hir::map as hir_map; use rustc::middle::def_id::DefId; use rustc::middle::lang_items::{ExchangeFreeFnLangItem, ExchangeMallocFnLangItem}; use rustc::traits; diff --git a/src/librustc_trans/common.rs b/src/librustc_trans/common.rs index 589e6f3266e..1f48eb91603 100644 --- a/src/librustc_trans/common.rs +++ b/src/librustc_trans/common.rs @@ -40,7 +40,7 @@ use value::Value; use rustc::ty::{self, Ty, TyCtxt}; use rustc::traits::{self, SelectionContext, ProjectionMode}; use rustc::ty::fold::{TypeFolder, TypeFoldable}; -use rustc_front::hir; +use rustc::hir; use util::nodemap::NodeMap; use arena::TypedArena; diff --git a/src/librustc_trans/consts.rs b/src/librustc_trans/consts.rs index 3e516c0eec4..7945639f86b 100644 --- a/src/librustc_trans/consts.rs +++ b/src/librustc_trans/consts.rs @@ -17,7 +17,7 @@ use rustc_const_eval::{ConstEvalErr, lookup_const_fn_by_id, lookup_const_by_id, use rustc_const_eval::eval_repeat_count; use middle::def::Def; use middle::def_id::DefId; -use rustc::front::map as hir_map; +use rustc::hir::map as hir_map; use {abi, adt, closure, debuginfo, expr, machine}; use base::{self, exported_name, imported_name, push_ctxt}; use callee::Callee; @@ -41,7 +41,7 @@ use rustc::ty::cast::{CastTy,IntTy}; use util::nodemap::NodeMap; use rustc_const_math::{ConstInt, ConstMathErr, ConstUsize, ConstIsize}; -use rustc_front::hir; +use rustc::hir; use std::ffi::{CStr, CString}; use std::borrow::Cow; diff --git a/src/librustc_trans/controlflow.rs b/src/librustc_trans/controlflow.rs index 6d4b02f076c..60ae91a8c5f 100644 --- a/src/librustc_trans/controlflow.rs +++ b/src/librustc_trans/controlflow.rs @@ -25,8 +25,8 @@ use debuginfo::{DebugLoc, ToDebugLoc}; use expr; use machine; -use rustc_front::hir; -use rustc_front::util as ast_util; +use rustc::hir; +use rustc::hir::util as ast_util; use syntax::ast; use syntax::parse::token::InternedString; diff --git a/src/librustc_trans/debuginfo/create_scope_map.rs b/src/librustc_trans/debuginfo/create_scope_map.rs index a7f2bf4a5fa..477dc0b4b52 100644 --- a/src/librustc_trans/debuginfo/create_scope_map.rs +++ b/src/librustc_trans/debuginfo/create_scope_map.rs @@ -21,8 +21,7 @@ use libc::c_uint; use syntax::codemap::{Span, Pos}; use syntax::{ast, codemap}; -use rustc_front; -use rustc_front::hir::{self, PatKind}; +use rustc::hir::{self, PatKind}; // This procedure builds the *scope map* for a given function, which maps any // given ast::NodeId in the function's AST to the correct DIScope metadata instance. @@ -117,7 +116,7 @@ fn walk_block(cx: &CrateContext, // The interesting things here are statements and the concluding expression. for statement in &block.stmts { - scope_map.insert(rustc_front::util::stmt_id(statement), + scope_map.insert(hir::util::stmt_id(statement), scope_stack.last().unwrap().scope_metadata); match statement.node { diff --git a/src/librustc_trans/debuginfo/metadata.rs b/src/librustc_trans/debuginfo/metadata.rs index 5690b18bc8e..acfafc6e329 100644 --- a/src/librustc_trans/debuginfo/metadata.rs +++ b/src/librustc_trans/debuginfo/metadata.rs @@ -27,8 +27,8 @@ use middle::def_id::DefId; use rustc::infer; use middle::pat_util; use rustc::ty::subst; -use rustc::front::map as hir_map; -use rustc_front::hir::{self, PatKind}; +use rustc::hir::map as hir_map; +use rustc::hir::{self, PatKind}; use {type_of, adt, machine, monomorphize}; use common::{self, CrateContext, FunctionContext, Block}; use _match::{BindingInfo, TransBindingMode}; diff --git a/src/librustc_trans/debuginfo/mod.rs b/src/librustc_trans/debuginfo/mod.rs index 6b92989cf46..f671c2b7963 100644 --- a/src/librustc_trans/debuginfo/mod.rs +++ b/src/librustc_trans/debuginfo/mod.rs @@ -29,8 +29,7 @@ use llvm::debuginfo::{DIFile, DIType, DIScope, DIBuilderRef, DISubprogram, DIArr use middle::def_id::DefId; use rustc::infer::normalize_associated_type; use rustc::ty::subst::{self, Substs}; -use rustc_front; -use rustc_front::hir; +use rustc::hir; use abi::Abi; use common::{NodeIdAndSpan, CrateContext, FunctionContext, Block}; @@ -39,7 +38,7 @@ use rustc::infer; use rustc::ty::{self, Ty}; use session::config::{self, FullDebugInfo, LimitedDebugInfo, NoDebugInfo}; use util::nodemap::{NodeMap, FnvHashMap, FnvHashSet}; -use rustc::front::map as hir_map; +use rustc::hir::map as hir_map; use libc::c_uint; use std::cell::{Cell, RefCell}; @@ -239,7 +238,7 @@ pub fn create_function_debug_context<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>, return FunctionDebugContext::FunctionWithoutDebugInfo; } - let empty_generics = rustc_front::util::empty_generics(); + let empty_generics = hir::util::empty_generics(); let fnitem = cx.tcx().map.get(fn_ast_id); diff --git a/src/librustc_trans/debuginfo/namespace.rs b/src/librustc_trans/debuginfo/namespace.rs index 445f85c52fc..1feb47a3a7d 100644 --- a/src/librustc_trans/debuginfo/namespace.rs +++ b/src/librustc_trans/debuginfo/namespace.rs @@ -15,7 +15,7 @@ use super::utils::{DIB, debug_context}; use llvm; use llvm::debuginfo::DIScope; use rustc::middle::def_id::DefId; -use rustc::front::map as hir_map; +use rustc::hir::map as hir_map; use common::CrateContext; use std::ffi::CString; diff --git a/src/librustc_trans/debuginfo/type_names.rs b/src/librustc_trans/debuginfo/type_names.rs index a6aa8df92db..f5bb1677f29 100644 --- a/src/librustc_trans/debuginfo/type_names.rs +++ b/src/librustc_trans/debuginfo/type_names.rs @@ -18,7 +18,7 @@ use rustc::infer; use rustc::ty::subst; use rustc::ty::{self, Ty}; -use rustc_front::hir; +use rustc::hir; // Compute the name of the type as it should be stored in debuginfo. Does not do // any caching, i.e. calling the function twice with the same type will also do diff --git a/src/librustc_trans/expr.rs b/src/librustc_trans/expr.rs index 5e193b96278..7c2557fb090 100644 --- a/src/librustc_trans/expr.rs +++ b/src/librustc_trans/expr.rs @@ -80,8 +80,7 @@ use util::common::indenter; use machine::{llsize_of, llsize_of_alloc}; use type_::Type; -use rustc_front; -use rustc_front::hir; +use rustc::hir; use syntax::{ast, codemap}; use syntax::parse::token::InternedString; @@ -1181,7 +1180,7 @@ fn trans_rvalue_dps_unadjusted<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, // if not overloaded, would be RvalueDatumExpr let lhs = unpack_datum!(bcx, trans(bcx, &lhs)); let mut rhs = unpack_datum!(bcx, trans(bcx, &rhs_expr)); - if !rustc_front::util::is_by_value_binop(op.node) { + if !hir::util::is_by_value_binop(op.node) { rhs = unpack_datum!(bcx, auto_ref(bcx, rhs, rhs_expr)); } @@ -1205,7 +1204,7 @@ fn trans_rvalue_dps_unadjusted<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, span_bug!( expr.span, "augmented assignment `{}=` should always be a rvalue_stmt", - rustc_front::util::binop_to_string(op.node)) + hir::util::binop_to_string(op.node)) } _ => { span_bug!( diff --git a/src/librustc_trans/inline.rs b/src/librustc_trans/inline.rs index 4d18e3bd495..36dfbec115e 100644 --- a/src/librustc_trans/inline.rs +++ b/src/librustc_trans/inline.rs @@ -17,7 +17,7 @@ use callee::Callee; use common::*; use rustc::dep_graph::DepNode; -use rustc_front::hir; +use rustc::hir; fn instantiate_inline(ccx: &CrateContext, fn_id: DefId) -> Option { debug!("instantiate_inline({:?})", fn_id); diff --git a/src/librustc_trans/intrinsic.rs b/src/librustc_trans/intrinsic.rs index 28d5d9ac176..355de31bf59 100644 --- a/src/librustc_trans/intrinsic.rs +++ b/src/librustc_trans/intrinsic.rs @@ -40,7 +40,7 @@ use rustc::ty::{self, Ty, TypeFoldable}; use Disr; use rustc::ty::subst::Substs; use rustc::dep_graph::DepNode; -use rustc_front::hir; +use rustc::hir; use syntax::ast; use syntax::ptr::P; use syntax::parse::token; diff --git a/src/librustc_trans/lib.rs b/src/librustc_trans/lib.rs index 8c6a68cfcf1..19a172e7f10 100644 --- a/src/librustc_trans/lib.rs +++ b/src/librustc_trans/lib.rs @@ -46,7 +46,6 @@ extern crate libc; #[macro_use] extern crate rustc; extern crate rustc_back; extern crate rustc_data_structures; -extern crate rustc_front; pub extern crate rustc_llvm as llvm; extern crate rustc_mir; extern crate rustc_platform_intrinsics as intrinsics; @@ -67,7 +66,7 @@ pub use disr::Disr; pub mod back { pub use rustc_back::rpath; - pub use rustc_back::svh; + pub use rustc::hir::svh; pub mod archive; pub mod linker; diff --git a/src/librustc_trans/mir/rvalue.rs b/src/librustc_trans/mir/rvalue.rs index 3f7a6c5f180..8e5d220b4f4 100644 --- a/src/librustc_trans/mir/rvalue.rs +++ b/src/librustc_trans/mir/rvalue.rs @@ -134,7 +134,7 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> { _ => { // FIXME Shouldn't need to manually trigger closure instantiations. if let mir::AggregateKind::Closure(def_id, substs) = *kind { - use rustc_front::hir; + use rustc::hir; use syntax::ast::DUMMY_NODE_ID; use syntax::codemap::DUMMY_SP; use syntax::ptr::P; diff --git a/src/librustc_trans/monomorphize.rs b/src/librustc_trans/monomorphize.rs index 554e1948fe9..de66951d091 100644 --- a/src/librustc_trans/monomorphize.rs +++ b/src/librustc_trans/monomorphize.rs @@ -23,10 +23,10 @@ use base; use common::*; use declare; use Disr; -use rustc::front::map as hir_map; +use rustc::hir::map as hir_map; use rustc::util::ppaux; -use rustc_front::hir; +use rustc::hir; use syntax::attr; use syntax::errors; diff --git a/src/librustc_trans/symbol_names_test.rs b/src/librustc_trans/symbol_names_test.rs index a75b6f736ee..2e3355968df 100644 --- a/src/librustc_trans/symbol_names_test.rs +++ b/src/librustc_trans/symbol_names_test.rs @@ -15,8 +15,8 @@ //! paths etc in all kinds of annoying scenarios. use back::symbol_names; -use rustc_front::hir; -use rustc_front::intravisit::{self, Visitor}; +use rustc::hir; +use rustc::hir::intravisit::{self, Visitor}; use syntax::ast; use syntax::attr::AttrMetaMethods; diff --git a/src/librustc_trans/tvec.rs b/src/librustc_trans/tvec.rs index b9af02ac529..f5b9bef5313 100644 --- a/src/librustc_trans/tvec.rs +++ b/src/librustc_trans/tvec.rs @@ -29,7 +29,7 @@ use type_of; use value::Value; use rustc::ty::{self, Ty}; -use rustc_front::hir; +use rustc::hir; use rustc_const_eval::eval_repeat_count; use syntax::ast; diff --git a/src/librustc_typeck/Cargo.toml b/src/librustc_typeck/Cargo.toml index 6f46686feb5..e9dabf16eae 100644 --- a/src/librustc_typeck/Cargo.toml +++ b/src/librustc_typeck/Cargo.toml @@ -17,5 +17,4 @@ rustc = { path = "../librustc" } rustc_back = { path = "../librustc_back" } rustc_const_eval = { path = "../librustc_const_eval" } rustc_const_math = { path = "../librustc_const_math" } -rustc_front = { path = "../librustc_front" } rustc_platform_intrinsics = { path = "../librustc_platform_intrinsics" } diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index d925ff9fa3c..a52b8cad108 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -74,8 +74,8 @@ use syntax::errors::DiagnosticBuilder; use syntax::feature_gate::{GateIssue, emit_feature_err}; use syntax::parse::token; -use rustc_front::print::pprust; -use rustc_front::hir; +use rustc::hir::print as pprust; +use rustc::hir; use rustc_back::slice; pub trait AstConv<'tcx> { diff --git a/src/librustc_typeck/check/_match.rs b/src/librustc_typeck/check/_match.rs index 55c3a5add37..5c93c170590 100644 --- a/src/librustc_typeck/check/_match.rs +++ b/src/librustc_typeck/check/_match.rs @@ -30,9 +30,9 @@ use syntax::ast; use syntax::codemap::{Span, Spanned}; use syntax::ptr::P; -use rustc_front::hir::{self, PatKind}; -use rustc_front::print::pprust; -use rustc_front::util as hir_util; +use rustc::hir::{self, PatKind}; +use rustc::hir::print as pprust; +use rustc::hir::util as hir_util; pub fn check_pat<'a, 'tcx>(pcx: &pat_ctxt<'a, 'tcx>, pat: &'tcx hir::Pat, diff --git a/src/librustc_typeck/check/callee.rs b/src/librustc_typeck/check/callee.rs index bedf4753313..460230c60c6 100644 --- a/src/librustc_typeck/check/callee.rs +++ b/src/librustc_typeck/check/callee.rs @@ -34,7 +34,7 @@ use syntax::codemap::Span; use syntax::parse::token; use syntax::ptr::P; -use rustc_front::hir; +use rustc::hir; /// Check that it is legal to call methods of the trait corresponding /// to `trait_id` (this only cares about the trait, not the specific diff --git a/src/librustc_typeck/check/cast.rs b/src/librustc_typeck/check/cast.rs index d743a036040..00a73a062fe 100644 --- a/src/librustc_typeck/check/cast.rs +++ b/src/librustc_typeck/check/cast.rs @@ -48,7 +48,7 @@ use middle::def_id::DefId; use rustc::ty::{self, Ty, TypeFoldable}; use rustc::ty::cast::{CastKind, CastTy}; use syntax::codemap::Span; -use rustc_front::hir; +use rustc::hir; use syntax::ast; diff --git a/src/librustc_typeck/check/closure.rs b/src/librustc_typeck/check/closure.rs index 9333b10d27e..7bca570411c 100644 --- a/src/librustc_typeck/check/closure.rs +++ b/src/librustc_typeck/check/closure.rs @@ -17,7 +17,7 @@ use rustc::ty::subst; use rustc::ty::{self, ToPolyTraitRef, Ty}; use std::cmp; use syntax::abi::Abi; -use rustc_front::hir; +use rustc::hir; pub fn check_expr_closure<'a,'tcx>(fcx: &FnCtxt<'a,'tcx>, expr: &hir::Expr, diff --git a/src/librustc_typeck/check/coercion.rs b/src/librustc_typeck/check/coercion.rs index cafd0519c28..f1c6868efd2 100644 --- a/src/librustc_typeck/check/coercion.rs +++ b/src/librustc_typeck/check/coercion.rs @@ -76,7 +76,7 @@ use util::common::indent; use std::cell::RefCell; use std::collections::VecDeque; -use rustc_front::hir; +use rustc::hir; struct Coerce<'a, 'tcx: 'a> { fcx: &'a FnCtxt<'a, 'tcx>, diff --git a/src/librustc_typeck/check/demand.rs b/src/librustc_typeck/check/demand.rs index bc2ef9aafee..5b163eb7de4 100644 --- a/src/librustc_typeck/check/demand.rs +++ b/src/librustc_typeck/check/demand.rs @@ -14,7 +14,7 @@ use rustc::ty::Ty; use rustc::infer::{InferOk, TypeOrigin}; use syntax::codemap::Span; -use rustc_front::hir; +use rustc::hir; // Requires that the two types unify, and prints an error message if // they don't. diff --git a/src/librustc_typeck/check/intrinsic.rs b/src/librustc_typeck/check/intrinsic.rs index 3c43e0d5217..eae0cfb0f22 100644 --- a/src/librustc_typeck/check/intrinsic.rs +++ b/src/librustc_typeck/check/intrinsic.rs @@ -26,7 +26,7 @@ use syntax::attr::AttrMetaMethods; use syntax::codemap::Span; use syntax::parse::token; -use rustc_front::hir; +use rustc::hir; fn equate_intrinsic_type<'a, 'tcx>(tcx: &TyCtxt<'tcx>, it: &hir::ForeignItem, n_tps: usize, diff --git a/src/librustc_typeck/check/method/confirm.rs b/src/librustc_typeck/check/method/confirm.rs index f90a5696539..cc12b2e0515 100644 --- a/src/librustc_typeck/check/method/confirm.rs +++ b/src/librustc_typeck/check/method/confirm.rs @@ -21,7 +21,7 @@ use rustc::ty::fold::TypeFoldable; use rustc::infer; use rustc::infer::{InferCtxt, TypeOrigin}; use syntax::codemap::Span; -use rustc_front::hir; +use rustc::hir; struct ConfirmContext<'a, 'tcx:'a> { fcx: &'a FnCtxt<'a, 'tcx>, diff --git a/src/librustc_typeck/check/method/mod.rs b/src/librustc_typeck/check/method/mod.rs index 43a18d2c102..72ca73aac94 100644 --- a/src/librustc_typeck/check/method/mod.rs +++ b/src/librustc_typeck/check/method/mod.rs @@ -23,7 +23,7 @@ use rustc::infer; use syntax::ast; use syntax::codemap::Span; -use rustc_front::hir; +use rustc::hir; pub use self::MethodError::*; pub use self::CandidateSource::*; diff --git a/src/librustc_typeck/check/method/probe.rs b/src/librustc_typeck/check/method/probe.rs index 2e15ac0e130..c907a6dc640 100644 --- a/src/librustc_typeck/check/method/probe.rs +++ b/src/librustc_typeck/check/method/probe.rs @@ -24,7 +24,7 @@ use rustc::ty::{self, NoPreference, Ty, TyCtxt, ToPolyTraitRef, TraitRef, TypeFo use rustc::infer::{self, InferCtxt, InferOk, TypeOrigin}; use syntax::ast; use syntax::codemap::{Span, DUMMY_SP}; -use rustc_front::hir; +use rustc::hir; use std::collections::HashSet; use std::mem; use std::rc::Rc; diff --git a/src/librustc_typeck/check/method/suggest.rs b/src/librustc_typeck/check/method/suggest.rs index 32b5a63817e..620863a7a2e 100644 --- a/src/librustc_typeck/check/method/suggest.rs +++ b/src/librustc_typeck/check/method/suggest.rs @@ -15,7 +15,7 @@ use CrateCtxt; use astconv::AstConv; use check::{self, FnCtxt, UnresolvedTypeAction, autoderef}; -use front::map as hir_map; +use rustc::hir::map as hir_map; use rustc::ty::{self, Ty, ToPolyTraitRef, ToPredicate, TypeFoldable}; use middle::cstore::{self, CrateStore}; use middle::def::Def; @@ -30,9 +30,9 @@ use util::nodemap::{FnvHashSet}; use syntax::ast; use syntax::codemap::Span; use syntax::errors::DiagnosticBuilder; -use rustc_front::print::pprust; -use rustc_front::hir; -use rustc_front::hir::Expr_; +use rustc::hir::print as pprust; +use rustc::hir; +use rustc::hir::Expr_; use std::cell; use std::cmp::Ordering; @@ -436,7 +436,7 @@ impl Ord for TraitInfo { /// Retrieve all traits in this crate and any dependent crates. pub fn all_traits<'a>(ccx: &'a CrateCtxt) -> AllTraits<'a> { if ccx.all_traits.borrow().is_none() { - use rustc_front::intravisit; + use rustc::hir::intravisit; let mut traits = vec![]; diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index e485fbe1621..20b9a75e0e5 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -124,10 +124,10 @@ use syntax::parse::token::{self, InternedString, special_idents}; use syntax::ptr::P; use syntax::util::lev_distance::find_best_match_for_name; -use rustc_front::intravisit::{self, Visitor}; -use rustc_front::hir; -use rustc_front::hir::{Visibility, PatKind}; -use rustc_front::print::pprust; +use rustc::hir::intravisit::{self, Visitor}; +use rustc::hir; +use rustc::hir::{Visibility, PatKind}; +use rustc::hir::print as pprust; use rustc_back::slice; use rustc_const_eval::eval_repeat_count; @@ -3987,7 +3987,7 @@ fn check_block_with_expected<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>, let mut any_err = false; for s in &blk.stmts { check_stmt(fcx, s); - let s_id = ::rustc_front::util::stmt_id(s); + let s_id = hir::util::stmt_id(s); let s_ty = fcx.node_ty(s_id); if any_diverges && !warned && match s.node { hir::StmtDecl(ref decl, _) => { diff --git a/src/librustc_typeck/check/op.rs b/src/librustc_typeck/check/op.rs index 494135ee3ff..1af015cdebf 100644 --- a/src/librustc_typeck/check/op.rs +++ b/src/librustc_typeck/check/op.rs @@ -22,8 +22,8 @@ use middle::def_id::DefId; use rustc::ty::{Ty, TypeFoldable, PreferMutLvalue}; use syntax::ast; use syntax::parse::token; -use rustc_front::hir; -use rustc_front::util as hir_util; +use rustc::hir; +use rustc::hir::util as hir_util; /// Check a `a = b` pub fn check_binop_assign<'a,'tcx>(fcx: &FnCtxt<'a,'tcx>, diff --git a/src/librustc_typeck/check/regionck.rs b/src/librustc_typeck/check/regionck.rs index 15bf6671de5..ed9372acba9 100644 --- a/src/librustc_typeck/check/regionck.rs +++ b/src/librustc_typeck/check/regionck.rs @@ -100,9 +100,9 @@ use rustc::ty::wf::ImpliedBound; use std::mem; use syntax::ast; use syntax::codemap::Span; -use rustc_front::intravisit::{self, Visitor}; -use rustc_front::hir::{self, PatKind}; -use rustc_front::util as hir_util; +use rustc::hir::intravisit::{self, Visitor}; +use rustc::hir::{self, PatKind}; +use rustc::hir::util as hir_util; use self::SubjectNode::Subject; diff --git a/src/librustc_typeck/check/upvar.rs b/src/librustc_typeck/check/upvar.rs index 7d51d5ec7f7..40481cda762 100644 --- a/src/librustc_typeck/check/upvar.rs +++ b/src/librustc_typeck/check/upvar.rs @@ -51,8 +51,8 @@ use rustc::infer::{InferCtxt, UpvarRegion}; use std::collections::HashSet; use syntax::ast; use syntax::codemap::Span; -use rustc_front::hir; -use rustc_front::intravisit::{self, Visitor}; +use rustc::hir; +use rustc::hir::intravisit::{self, Visitor}; /////////////////////////////////////////////////////////////////////////// // PUBLIC ENTRY POINTS diff --git a/src/librustc_typeck/check/wfcheck.rs b/src/librustc_typeck/check/wfcheck.rs index 68c9816b48c..0ed0b64b970 100644 --- a/src/librustc_typeck/check/wfcheck.rs +++ b/src/librustc_typeck/check/wfcheck.rs @@ -25,8 +25,8 @@ use syntax::ast; use syntax::codemap::{Span}; use syntax::errors::DiagnosticBuilder; use syntax::parse::token::{special_idents}; -use rustc_front::intravisit::{self, Visitor}; -use rustc_front::hir; +use rustc::hir::intravisit::{self, Visitor}; +use rustc::hir; pub struct CheckTypeWellFormedVisitor<'ccx, 'tcx:'ccx> { ccx: &'ccx CrateCtxt<'ccx, 'tcx>, diff --git a/src/librustc_typeck/check/writeback.rs b/src/librustc_typeck/check/writeback.rs index 7ede85454e9..6ac6f1d6e17 100644 --- a/src/librustc_typeck/check/writeback.rs +++ b/src/librustc_typeck/check/writeback.rs @@ -28,10 +28,10 @@ use std::cell::Cell; use syntax::ast; use syntax::codemap::{DUMMY_SP, Span}; -use rustc_front::print::pprust::pat_to_string; -use rustc_front::intravisit::{self, Visitor}; -use rustc_front::util as hir_util; -use rustc_front::hir; +use rustc::hir::print::pat_to_string; +use rustc::hir::intravisit::{self, Visitor}; +use rustc::hir::util as hir_util; +use rustc::hir; /////////////////////////////////////////////////////////////////////////// // Entry point functions diff --git a/src/librustc_typeck/coherence/mod.rs b/src/librustc_typeck/coherence/mod.rs index f9a4cfadc0b..1f7fc453279 100644 --- a/src/librustc_typeck/coherence/mod.rs +++ b/src/librustc_typeck/coherence/mod.rs @@ -39,10 +39,10 @@ use syntax::codemap::Span; use syntax::errors::DiagnosticBuilder; use util::nodemap::{DefIdMap, FnvHashMap}; use rustc::dep_graph::DepNode; -use rustc::front::map as hir_map; -use rustc_front::intravisit; -use rustc_front::hir::{Item, ItemImpl}; -use rustc_front::hir; +use rustc::hir::map as hir_map; +use rustc::hir::intravisit; +use rustc::hir::{Item, ItemImpl}; +use rustc::hir; mod orphan; mod overlap; diff --git a/src/librustc_typeck/coherence/orphan.rs b/src/librustc_typeck/coherence/orphan.rs index eba3e56c722..0821d5582bd 100644 --- a/src/librustc_typeck/coherence/orphan.rs +++ b/src/librustc_typeck/coherence/orphan.rs @@ -18,8 +18,8 @@ use rustc::ty::{self, TyCtxt}; use syntax::ast; use syntax::codemap::Span; use rustc::dep_graph::DepNode; -use rustc_front::intravisit; -use rustc_front::hir; +use rustc::hir::intravisit; +use rustc::hir; pub fn check(tcx: &TyCtxt) { let mut orphan = OrphanChecker { tcx: tcx }; diff --git a/src/librustc_typeck/coherence/overlap.rs b/src/librustc_typeck/coherence/overlap.rs index d7d4560a4ea..d99c5d52f4a 100644 --- a/src/librustc_typeck/coherence/overlap.rs +++ b/src/librustc_typeck/coherence/overlap.rs @@ -19,8 +19,8 @@ use rustc::infer; use rustc::ty::{self, TyCtxt}; use syntax::ast; use rustc::dep_graph::DepNode; -use rustc_front::hir; -use rustc_front::intravisit; +use rustc::hir; +use rustc::hir::intravisit; use util::nodemap::DefIdMap; use lint; diff --git a/src/librustc_typeck/coherence/unsafety.rs b/src/librustc_typeck/coherence/unsafety.rs index 6d77200daa3..b042e23e0ac 100644 --- a/src/librustc_typeck/coherence/unsafety.rs +++ b/src/librustc_typeck/coherence/unsafety.rs @@ -12,8 +12,8 @@ //! crate or pertains to a type defined in this crate. use rustc::ty::TyCtxt; -use rustc_front::intravisit; -use rustc_front::hir; +use rustc::hir::intravisit; +use rustc::hir; pub fn check(tcx: &TyCtxt) { let mut orphan = UnsafetyChecker { tcx: tcx }; diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index 59546f619c0..53126d3494a 100644 --- a/src/librustc_typeck/collect.rs +++ b/src/librustc_typeck/collect.rs @@ -77,7 +77,7 @@ use rustc::ty::fold::{TypeFolder}; use rustc::ty::util::IntTypeExt; use rscope::*; use rustc::dep_graph::DepNode; -use rustc::front::map as hir_map; +use rustc::hir::map as hir_map; use util::common::{ErrorReported, MemoizationMap}; use util::nodemap::{FnvHashMap, FnvHashSet}; use write_ty_to_tcx; @@ -94,9 +94,9 @@ use syntax::attr; use syntax::codemap::Span; use syntax::parse::token::special_idents; use syntax::ptr::P; -use rustc_front::hir::{self, PatKind}; -use rustc_front::intravisit; -use rustc_front::print::pprust; +use rustc::hir::{self, PatKind}; +use rustc::hir::intravisit; +use rustc::hir::print as pprust; /////////////////////////////////////////////////////////////////////////// // Main entry point diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs index fa23445fe63..af32026d47e 100644 --- a/src/librustc_typeck/lib.rs +++ b/src/librustc_typeck/lib.rs @@ -90,20 +90,19 @@ extern crate arena; extern crate fmt_macros; #[macro_use] extern crate rustc; extern crate rustc_platform_intrinsics as intrinsics; -extern crate rustc_front; extern crate rustc_back; extern crate rustc_const_math; extern crate rustc_const_eval; pub use rustc::dep_graph; -pub use rustc::front; +pub use rustc::hir; pub use rustc::lint; pub use rustc::middle; pub use rustc::session; pub use rustc::util; use dep_graph::DepNode; -use front::map as hir_map; +use hir::map as hir_map; use middle::def::Def; use rustc::infer::{self, TypeOrigin}; use rustc::ty::subst::Substs; @@ -111,7 +110,6 @@ use rustc::ty::{self, Ty, TyCtxt, TypeFoldable}; use rustc::traits::ProjectionMode; use session::{config, CompileResult}; use util::common::time; -use rustc_front::hir; use syntax::codemap::Span; use syntax::ast; diff --git a/src/librustc_typeck/variance/constraints.rs b/src/librustc_typeck/variance/constraints.rs index 50c99e33b44..fa3ee80c6da 100644 --- a/src/librustc_typeck/variance/constraints.rs +++ b/src/librustc_typeck/variance/constraints.rs @@ -20,10 +20,10 @@ use rustc::ty::subst; use rustc::ty::subst::ParamSpace; use rustc::ty::{self, Ty, TyCtxt}; use rustc::ty::maps::ItemVariances; -use rustc::front::map as hir_map; +use rustc::hir::map as hir_map; use syntax::ast; -use rustc_front::hir; -use rustc_front::intravisit::Visitor; +use rustc::hir; +use rustc::hir::intravisit::Visitor; use super::terms::*; use super::terms::VarianceTerm::*; diff --git a/src/librustc_typeck/variance/terms.rs b/src/librustc_typeck/variance/terms.rs index c6f82ba42e6..413dc83e638 100644 --- a/src/librustc_typeck/variance/terms.rs +++ b/src/librustc_typeck/variance/terms.rs @@ -27,8 +27,8 @@ use rustc::ty::maps::ItemVariances; use std::fmt; use std::rc::Rc; use syntax::ast; -use rustc_front::hir; -use rustc_front::intravisit::Visitor; +use rustc::hir; +use rustc::hir::intravisit::Visitor; use util::nodemap::NodeMap; use self::VarianceTerm::*; diff --git a/src/librustdoc/Cargo.toml b/src/librustdoc/Cargo.toml index 228eb099a04..9d76dd81e5f 100644 --- a/src/librustdoc/Cargo.toml +++ b/src/librustdoc/Cargo.toml @@ -15,7 +15,6 @@ rustc = { path = "../librustc" } rustc_back = { path = "../librustc_back" } rustc_const_eval = { path = "../librustc_const_eval" } rustc_driver = { path = "../librustc_driver" } -rustc_front = { path = "../librustc_front" } rustc_lint = { path = "../librustc_lint" } rustc_metadata = { path = "../librustc_metadata" } rustc_resolve = { path = "../librustc_resolve" } diff --git a/src/librustdoc/clean/inline.rs b/src/librustdoc/clean/inline.rs index 3e4ba47ce4c..2f080dae370 100644 --- a/src/librustdoc/clean/inline.rs +++ b/src/librustdoc/clean/inline.rs @@ -14,7 +14,7 @@ use std::collections::HashSet; use syntax::ast; use syntax::attr::AttrMetaMethods; -use rustc_front::hir; +use rustc::hir; use rustc::middle::cstore::{self, CrateStore}; use rustc::middle::def::Def; @@ -484,7 +484,7 @@ fn build_module(cx: &DocContext, tcx: &TyCtxt, fn build_const(cx: &DocContext, tcx: &TyCtxt, did: DefId) -> clean::Constant { - use rustc_front::print::pprust; + use rustc::hir::print as pprust; let (expr, ty) = lookup_const_by_id(tcx, did, None).unwrap_or_else(|| { panic!("expected lookup_const_by_id to succeed for {:?}", did); diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 7437d608771..715d0e759c3 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -41,7 +41,7 @@ use rustc::ty::subst::{self, ParamSpace, VecPerParamSpace}; use rustc::ty; use rustc::middle::stability; -use rustc_front::hir; +use rustc::hir; use std::collections::{HashMap, HashSet}; use std::path::PathBuf; @@ -563,7 +563,7 @@ pub enum TyParamBound { impl TyParamBound { fn maybe_sized(cx: &DocContext) -> TyParamBound { - use rustc_front::hir::TraitBoundModifier as TBM; + use rustc::hir::TraitBoundModifier as TBM; let mut sized_bound = ty::BoundSized.clean(cx); if let TyParamBound::TraitBound(_, ref mut tbm) = sized_bound { *tbm = TBM::Maybe @@ -572,7 +572,7 @@ impl TyParamBound { } fn is_sized_bound(&self, cx: &DocContext) -> bool { - use rustc_front::hir::TraitBoundModifier as TBM; + use rustc::hir::TraitBoundModifier as TBM; if let Some(tcx) = cx.tcx_opt() { if let TyParamBound::TraitBound(PolyTrait { ref trait_, .. }, TBM::None) = *self { if trait_.def_id() == tcx.lang_items.sized_trait() { @@ -1609,7 +1609,7 @@ impl PrimitiveType { impl Clean for hir::Ty { fn clean(&self, cx: &DocContext) -> Type { - use rustc_front::hir::*; + use rustc::hir::*; match self.node { TyPtr(ref m) => RawPointer(m.mutbl.clean(cx), box m.ty.clean(cx)), TyRptr(ref l, ref m) => @@ -1826,7 +1826,7 @@ pub struct VariantStruct { pub fields_stripped: bool, } -impl Clean for ::rustc_front::hir::VariantData { +impl Clean for ::rustc::hir::VariantData { fn clean(&self, cx: &DocContext) -> VariantStruct { VariantStruct { struct_type: doctree::struct_type_from_def(self), @@ -2554,7 +2554,7 @@ fn lit_to_string(lit: &ast::Lit) -> String { } fn name_from_pat(p: &hir::Pat) -> String { - use rustc_front::hir::*; + use rustc::hir::*; debug!("Trying to get a name from pattern: {:?}", p); match p.node { diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index 15a10a84e43..4686e60be87 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -16,11 +16,11 @@ use rustc::session::{self, config}; use rustc::middle::def_id::DefId; use rustc::middle::privacy::AccessLevels; use rustc::ty::{self, TyCtxt}; -use rustc::front::map as hir_map; +use rustc::hir::map as hir_map; use rustc::lint; use rustc_trans::back::link; use rustc_resolve as resolve; -use rustc_front::lowering::{lower_crate, LoweringContext}; +use rustc::hir::lowering::{lower_crate, LoweringContext}; use rustc_metadata::cstore::CStore; use syntax::{ast, codemap, errors}; diff --git a/src/librustdoc/doctree.rs b/src/librustdoc/doctree.rs index fc0422b3a3f..2db4b779eed 100644 --- a/src/librustdoc/doctree.rs +++ b/src/librustdoc/doctree.rs @@ -20,7 +20,7 @@ use syntax::ast; use syntax::ast::{Name, NodeId}; use syntax::attr; use syntax::ptr::P; -use rustc_front::hir; +use rustc::hir; pub struct Module { pub name: Option, diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index e9a883d6d7a..9f0b636227f 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -21,7 +21,7 @@ use std::iter::repeat; use rustc::middle::cstore::LOCAL_CRATE; use rustc::middle::def_id::{CRATE_DEF_INDEX, DefId}; use syntax::abi::Abi; -use rustc_front::hir; +use rustc::hir; use clean; use html::item_type::ItemType; diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 1427dfcbaf1..f97d4fee053 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -60,7 +60,7 @@ use rustc::middle::def_id::{CRATE_DEF_INDEX, DefId}; use rustc::middle::privacy::AccessLevels; use rustc::middle::stability; use rustc::session::config::get_unstable_features_setting; -use rustc_front::hir; +use rustc::hir; use clean::{self, SelfTy, Attributes, GetDefId}; use doctree; diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index a35fe20b6b6..9439c258318 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -41,7 +41,6 @@ extern crate rustc_driver; extern crate rustc_resolve; extern crate rustc_lint; extern crate rustc_back; -extern crate rustc_front; extern crate rustc_metadata; extern crate serialize; #[macro_use] extern crate syntax; diff --git a/src/librustdoc/passes.rs b/src/librustdoc/passes.rs index f93ecb46228..31f00caee43 100644 --- a/src/librustdoc/passes.rs +++ b/src/librustdoc/passes.rs @@ -14,7 +14,7 @@ use rustc::util::nodemap::DefIdSet; use std::cmp; use std::string::String; use std::usize; -use rustc_front::hir; +use rustc::hir; use clean::{self, Attributes, GetDefId}; use clean::Item; diff --git a/src/librustdoc/test.rs b/src/librustdoc/test.rs index 5bd3b9c4f59..3810fb87acf 100644 --- a/src/librustdoc/test.rs +++ b/src/librustdoc/test.rs @@ -24,11 +24,11 @@ use std::sync::{Arc, Mutex}; use testing; use rustc_lint; use rustc::dep_graph::DepGraph; -use rustc::front::map as hir_map; +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_front::lowering::{lower_crate, LoweringContext}; +use rustc::hir::lowering::{lower_crate, LoweringContext}; use rustc_back::dynamic_lib::DynamicLibrary; use rustc_back::tempdir::TempDir; use rustc_driver::{driver, Compilation}; @@ -141,7 +141,7 @@ pub fn run(input: &str, } // Look for #![doc(test(no_crate_inject))], used by crates in the std facade -fn scrape_test_config(krate: &::rustc_front::hir::Crate) -> TestOptions { +fn scrape_test_config(krate: &::rustc::hir::Crate) -> TestOptions { use syntax::attr::AttrMetaMethods; use syntax::print::pprust; diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs index e4ef0c1a4d6..45c7969ef7c 100644 --- a/src/librustdoc/visit_ast.rs +++ b/src/librustdoc/visit_ast.rs @@ -20,10 +20,10 @@ use syntax::attr; use syntax::attr::AttrMetaMethods; use syntax::codemap::Span; -use rustc::front::map as hir_map; +use rustc::hir::map as hir_map; use rustc::middle::stability; -use rustc_front::hir; +use rustc::hir; use core; use clean::{Clean, Attributes}; diff --git a/src/rustc/Cargo.lock b/src/rustc/Cargo.lock index 3f0d5086a17..4b5c2850dab 100644 --- a/src/rustc/Cargo.lock +++ b/src/rustc/Cargo.lock @@ -75,7 +75,6 @@ dependencies = [ "rustc_bitflags 0.0.0", "rustc_const_eval 0.0.0", "rustc_data_structures 0.0.0", - "rustc_front 0.0.0", "serialize 0.0.0", "syntax 0.0.0", ] @@ -85,7 +84,6 @@ name = "rustc_back" version = "0.0.0" dependencies = [ "log 0.0.0", - "rustc_front 0.0.0", "serialize 0.0.0", "syntax 0.0.0", ] @@ -101,7 +99,6 @@ dependencies = [ "graphviz 0.0.0", "log 0.0.0", "rustc 0.0.0", - "rustc_front 0.0.0", "rustc_mir 0.0.0", "syntax 0.0.0", ] @@ -134,7 +131,6 @@ dependencies = [ "rustc 0.0.0", "rustc_back 0.0.0", "rustc_borrowck 0.0.0", - "rustc_front 0.0.0", "rustc_lint 0.0.0", "rustc_llvm 0.0.0", "rustc_metadata 0.0.0", @@ -151,16 +147,6 @@ dependencies = [ "syntax_ext 0.0.0", ] -[[package]] -name = "rustc_front" -version = "0.0.0" -dependencies = [ - "log 0.0.0", - "rustc_bitflags 0.0.0", - "serialize 0.0.0", - "syntax 0.0.0", -] - [[package]] name = "rustc_lint" version = "0.0.0" @@ -168,7 +154,6 @@ dependencies = [ "log 0.0.0", "rustc 0.0.0", "rustc_back 0.0.0", - "rustc_front 0.0.0", "syntax 0.0.0", ] @@ -192,7 +177,6 @@ dependencies = [ "rustc_back 0.0.0", "rustc_bitflags 0.0.0", "rustc_const_eval 0.0.0", - "rustc_front 0.0.0", "rustc_llvm 0.0.0", "serialize 0.0.0", "syntax 0.0.0", @@ -208,7 +192,6 @@ dependencies = [ "rustc_back 0.0.0", "rustc_const_eval 0.0.0", "rustc_data_structures 0.0.0", - "rustc_front 0.0.0", "syntax 0.0.0", ] @@ -218,7 +201,6 @@ version = "0.0.0" dependencies = [ "log 0.0.0", "rustc 0.0.0", - "rustc_front 0.0.0", "syntax 0.0.0", ] @@ -234,7 +216,6 @@ dependencies = [ "rustc 0.0.0", "rustc_back 0.0.0", "rustc_bitflags 0.0.0", - "rustc_front 0.0.0", "rustc_metadata 0.0.0", "rustc_mir 0.0.0", "syntax 0.0.0", @@ -246,7 +227,6 @@ version = "0.0.0" dependencies = [ "log 0.0.0", "rustc 0.0.0", - "rustc_front 0.0.0", "syntax 0.0.0", ] @@ -258,7 +238,6 @@ dependencies = [ "log 0.0.0", "rustc 0.0.0", "rustc_bitflags 0.0.0", - "rustc_front 0.0.0", "syntax 0.0.0", ] @@ -284,7 +263,6 @@ dependencies = [ "rustc_back 0.0.0", "rustc_const_eval 0.0.0", "rustc_data_structures 0.0.0", - "rustc_front 0.0.0", "rustc_llvm 0.0.0", "rustc_mir 0.0.0", "rustc_platform_intrinsics 0.0.0", @@ -302,7 +280,6 @@ dependencies = [ "rustc 0.0.0", "rustc_back 0.0.0", "rustc_const_eval 0.0.0", - "rustc_front 0.0.0", "rustc_platform_intrinsics 0.0.0", "syntax 0.0.0", ] @@ -318,7 +295,6 @@ dependencies = [ "rustc 0.0.0", "rustc_back 0.0.0", "rustc_driver 0.0.0", - "rustc_front 0.0.0", "rustc_lint 0.0.0", "rustc_metadata 0.0.0", "rustc_resolve 0.0.0", diff --git a/src/test/auxiliary/dummy_mir_pass.rs b/src/test/auxiliary/dummy_mir_pass.rs index fc1ef4d41a8..b5234af937b 100644 --- a/src/test/auxiliary/dummy_mir_pass.rs +++ b/src/test/auxiliary/dummy_mir_pass.rs @@ -14,7 +14,6 @@ #![feature(box_syntax)] #[macro_use] extern crate rustc; -extern crate rustc_front; extern crate rustc_plugin; extern crate rustc_const_math; extern crate syntax; diff --git a/src/test/auxiliary/lint_for_crate.rs b/src/test/auxiliary/lint_for_crate.rs index 1933188ccbf..a424517da12 100644 --- a/src/test/auxiliary/lint_for_crate.rs +++ b/src/test/auxiliary/lint_for_crate.rs @@ -14,13 +14,12 @@ #![feature(box_syntax)] #[macro_use] extern crate rustc; -extern crate rustc_front; extern crate rustc_plugin; extern crate syntax; use rustc::lint::{LateContext, LintContext, LintPass, LateLintPass, LateLintPassObject, LintArray}; use rustc_plugin::Registry; -use rustc_front::hir; +use rustc::hir; use syntax::attr; declare_lint!(CRATE_NOT_OKAY, Warn, "crate not marked with #![crate_okay]"); diff --git a/src/test/auxiliary/lint_group_plugin_test.rs b/src/test/auxiliary/lint_group_plugin_test.rs index 98ed86bb390..1e9a77724a8 100644 --- a/src/test/auxiliary/lint_group_plugin_test.rs +++ b/src/test/auxiliary/lint_group_plugin_test.rs @@ -13,14 +13,12 @@ #![feature(plugin_registrar)] #![feature(box_syntax, rustc_private)] -extern crate rustc_front; - // Load rustc as a plugin to get macros #[macro_use] extern crate rustc; extern crate rustc_plugin; -use rustc_front::hir; +use rustc::hir; use rustc::lint::{LateContext, LintContext, LintPass, LateLintPass, LateLintPassObject, LintArray}; use rustc_plugin::Registry; diff --git a/src/test/run-make/execution-engine/test.rs b/src/test/run-make/execution-engine/test.rs index 81ad276ca68..91b4f5f30ad 100644 --- a/src/test/run-make/execution-engine/test.rs +++ b/src/test/run-make/execution-engine/test.rs @@ -14,7 +14,6 @@ extern crate libc; extern crate rustc; extern crate rustc_driver; -extern crate rustc_front; extern crate rustc_lint; extern crate rustc_llvm as llvm; extern crate rustc_metadata; @@ -28,13 +27,13 @@ use std::rc::Rc; use std::thread::Builder; use rustc::dep_graph::DepGraph; -use rustc::front::map as ast_map; +use rustc::hir::map as ast_map; use rustc::middle::cstore::{CrateStore, LinkagePreference}; use rustc::ty; use rustc::session::config::{self, basic_options, build_configuration, Input, Options}; use rustc::session::build_session; use rustc_driver::{driver, abort_on_err}; -use rustc_front::lowering::{lower_crate, LoweringContext}; +use rustc::hir::lowering::{lower_crate, LoweringContext}; use rustc_resolve::MakeGlobMap; use rustc_metadata::cstore::CStore; use libc::c_void;