Move code into librustc_traits
This commit is contained in:
parent
04b228c3e2
commit
2bbd16de13
@ -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<ty::Binder<Clause<'tcx>>>),
|
||||
}
|
||||
|
||||
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
|
||||
|
@ -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()));
|
||||
})
|
||||
|
@ -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
|
||||
};
|
||||
}
|
||||
|
@ -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<T> {
|
||||
fn lower(&self) -> T;
|
||||
@ -72,7 +72,7 @@ impl<'tcx, T> Lower<Goal<'tcx>> for ty::Binder<T>
|
||||
|
||||
impl<'tcx> Lower<Goal<'tcx>> 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<Goal<'tcx>> 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<Vec<Clause<'tcx>>>
|
||||
{
|
||||
let node_id = tcx.hir.as_local_node_id(def_id).unwrap();
|
Loading…
x
Reference in New Issue
Block a user