Skip to content

Commit 2bbd16d

Browse files
committed
Move code into librustc_traits
1 parent 04b228c commit 2bbd16d

File tree

4 files changed

+13
-15
lines changed

4 files changed

+13
-15
lines changed

src/librustc/traits/mod.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ mod specialize;
6363
mod structural_impls;
6464
pub mod trans;
6565
mod util;
66-
mod lowering;
6766

6867
pub mod query;
6968

@@ -297,10 +296,6 @@ pub enum Clause<'tcx> {
297296
ForAll(Box<ty::Binder<Clause<'tcx>>>),
298297
}
299298

300-
pub fn dump_program_clauses<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
301-
lowering::dump_program_clauses(tcx)
302-
}
303-
304299
pub type Selection<'tcx> = Vtable<'tcx, PredicateObligation<'tcx>>;
305300

306301
#[derive(Clone,Debug)]
@@ -972,7 +967,6 @@ pub fn provide(providers: &mut ty::maps::Providers) {
972967
specialization_graph_of: specialize::specialization_graph_provider,
973968
specializes: specialize::specializes,
974969
trans_fulfill_obligation: trans::trans_fulfill_obligation,
975-
program_clauses_for: lowering::program_clauses_for,
976970
vtable_methods,
977971
substitute_normalize_and_test_predicates,
978972
..*providers

src/librustc_driver/driver.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,9 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(trans: &TransCrate,
10891089

10901090
time(sess, "lint checking", || lint::check_crate(tcx));
10911091

1092-
time(sess, "dumping chalk-like clauses", || traits::dump_program_clauses(tcx));
1092+
time(sess,
1093+
"dumping chalk-like clauses",
1094+
|| rustc_traits::lowering::dump_program_clauses(tcx));
10931095

10941096
return Ok(f(tcx, analysis, rx, tcx.sess.compile_status()));
10951097
})

src/librustc_traits/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ mod dropck_outlives;
2929
mod normalize_projection_ty;
3030
mod normalize_erasing_regions;
3131
mod util;
32+
pub mod lowering;
3233

3334
use rustc::ty::maps::Providers;
3435

@@ -39,6 +40,7 @@ pub fn provide(p: &mut Providers) {
3940
normalize_projection_ty: normalize_projection_ty::normalize_projection_ty,
4041
normalize_ty_after_erasing_regions:
4142
normalize_erasing_regions::normalize_ty_after_erasing_regions,
43+
program_clauses_for: lowering::program_clauses_for,
4244
..*p
4345
};
4446
}

src/librustc/traits/lowering.rs renamed to src/librustc_traits/lowering.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use hir::{self, ImplPolarity};
12-
use hir::def_id::DefId;
13-
use hir::intravisit::{self, NestedVisitorMap, Visitor};
14-
use ty::{self, TyCtxt};
15-
use super::{QuantifierKind, Goal, DomainGoal, Clause, WhereClauseAtom};
16-
use rustc_data_structures::sync::Lrc;
11+
use rustc::hir::{self, ImplPolarity};
12+
use rustc::hir::def_id::DefId;
13+
use rustc::hir::intravisit::{self, NestedVisitorMap, Visitor};
14+
use rustc::ty::{self, TyCtxt};
15+
use rustc::traits::{QuantifierKind, Goal, DomainGoal, Clause, WhereClauseAtom};
1716
use syntax::ast;
17+
use rustc_data_structures::sync::Lrc;
1818

1919
trait Lower<T> {
2020
fn lower(&self) -> T;
@@ -72,7 +72,7 @@ impl<'tcx, T> Lower<Goal<'tcx>> for ty::Binder<T>
7272

7373
impl<'tcx> Lower<Goal<'tcx>> for ty::Predicate<'tcx> {
7474
fn lower(&self) -> Goal<'tcx> {
75-
use ty::Predicate::*;
75+
use rustc::ty::Predicate::*;
7676

7777
match self {
7878
Trait(predicate) => predicate.lower(),
@@ -88,7 +88,7 @@ impl<'tcx> Lower<Goal<'tcx>> for ty::Predicate<'tcx> {
8888
}
8989
}
9090

91-
pub fn program_clauses_for<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId)
91+
crate fn program_clauses_for<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId)
9292
-> Lrc<Vec<Clause<'tcx>>>
9393
{
9494
let node_id = tcx.hir.as_local_node_id(def_id).unwrap();

0 commit comments

Comments
 (0)