diff --git a/src/librustc/traits/mod.rs b/src/librustc/traits/mod.rs index ea3db0c6e926..dce1a89d1426 100644 --- a/src/librustc/traits/mod.rs +++ b/src/librustc/traits/mod.rs @@ -63,7 +63,6 @@ mod specialize; mod structural_impls; pub mod trans; mod util; -mod lowering; pub mod query; @@ -297,10 +296,6 @@ pub enum Clause<'tcx> { ForAll(Box>>), } -pub fn dump_program_clauses<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) { - lowering::dump_program_clauses(tcx) -} - pub type Selection<'tcx> = Vtable<'tcx, PredicateObligation<'tcx>>; #[derive(Clone,Debug)] @@ -972,7 +967,6 @@ pub fn provide(providers: &mut ty::maps::Providers) { specialization_graph_of: specialize::specialization_graph_provider, specializes: specialize::specializes, trans_fulfill_obligation: trans::trans_fulfill_obligation, - program_clauses_for: lowering::program_clauses_for, vtable_methods, substitute_normalize_and_test_predicates, ..*providers diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index 68c9c946215d..61335391dab7 100644 --- a/src/librustc_driver/driver.rs +++ b/src/librustc_driver/driver.rs @@ -1089,7 +1089,9 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(trans: &TransCrate, time(sess, "lint checking", || lint::check_crate(tcx)); - time(sess, "dumping chalk-like clauses", || traits::dump_program_clauses(tcx)); + time(sess, + "dumping chalk-like clauses", + || rustc_traits::lowering::dump_program_clauses(tcx)); return Ok(f(tcx, analysis, rx, tcx.sess.compile_status())); }) diff --git a/src/librustc_traits/lib.rs b/src/librustc_traits/lib.rs index 45d23a2733a2..2a0f076cefde 100644 --- a/src/librustc_traits/lib.rs +++ b/src/librustc_traits/lib.rs @@ -29,6 +29,7 @@ mod dropck_outlives; mod normalize_projection_ty; mod normalize_erasing_regions; mod util; +pub mod lowering; use rustc::ty::maps::Providers; @@ -39,6 +40,7 @@ pub fn provide(p: &mut Providers) { normalize_projection_ty: normalize_projection_ty::normalize_projection_ty, normalize_ty_after_erasing_regions: normalize_erasing_regions::normalize_ty_after_erasing_regions, + program_clauses_for: lowering::program_clauses_for, ..*p }; } diff --git a/src/librustc/traits/lowering.rs b/src/librustc_traits/lowering.rs similarity index 93% rename from src/librustc/traits/lowering.rs rename to src/librustc_traits/lowering.rs index f31e474963ee..b69d97b67e83 100644 --- a/src/librustc/traits/lowering.rs +++ b/src/librustc_traits/lowering.rs @@ -8,13 +8,13 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use hir::{self, ImplPolarity}; -use hir::def_id::DefId; -use hir::intravisit::{self, NestedVisitorMap, Visitor}; -use ty::{self, TyCtxt}; -use super::{QuantifierKind, Goal, DomainGoal, Clause, WhereClauseAtom}; -use rustc_data_structures::sync::Lrc; +use rustc::hir::{self, ImplPolarity}; +use rustc::hir::def_id::DefId; +use rustc::hir::intravisit::{self, NestedVisitorMap, Visitor}; +use rustc::ty::{self, TyCtxt}; +use rustc::traits::{QuantifierKind, Goal, DomainGoal, Clause, WhereClauseAtom}; use syntax::ast; +use rustc_data_structures::sync::Lrc; trait Lower { fn lower(&self) -> T; @@ -72,7 +72,7 @@ impl<'tcx, T> Lower> for ty::Binder impl<'tcx> Lower> for ty::Predicate<'tcx> { fn lower(&self) -> Goal<'tcx> { - use ty::Predicate::*; + use rustc::ty::Predicate::*; match self { Trait(predicate) => predicate.lower(), @@ -88,7 +88,7 @@ impl<'tcx> Lower> for ty::Predicate<'tcx> { } } -pub fn program_clauses_for<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) +crate fn program_clauses_for<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> Lrc>> { let node_id = tcx.hir.as_local_node_id(def_id).unwrap();