Skip to content

Commit b5650f9

Browse files
committed
Parallel code
1 parent 6ee8e0f commit b5650f9

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

src/librustc_borrowck/borrowck/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ pub struct LoanDataFlowOperator;
6767
pub type LoanDataFlow<'a, 'tcx> = DataFlowContext<'a, 'tcx, LoanDataFlowOperator>;
6868

6969
pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
70-
for body_owner_def_id in tcx.body_owners() {
70+
tcx.par_body_owners(|body_owner_def_id| {
7171
tcx.borrowck(body_owner_def_id);
72-
}
72+
});
7373
}
7474

7575
pub fn provide(providers: &mut Providers) {

src/librustc_borrowck/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#![feature(from_ref)]
1818
#![feature(quote)]
1919

20+
#![recursion_limit="256"]
21+
2022
#[macro_use] extern crate log;
2123
extern crate syntax;
2224
extern crate syntax_pos;

src/librustc_driver/driver.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -1272,11 +1272,9 @@ where
12721272

12731273
time(sess, "borrow checking", || borrowck::check_crate(tcx));
12741274

1275-
time(sess, "MIR borrow checking", || {
1276-
for def_id in tcx.body_owners() {
1277-
tcx.mir_borrowck(def_id);
1278-
}
1279-
});
1275+
time(sess,
1276+
"MIR borrow checking",
1277+
|| tcx.par_body_owners(|def_id| { tcx.mir_borrowck(def_id); }));
12801278

12811279
time(sess, "dumping chalk-like clauses", || {
12821280
rustc_traits::lowering::dump_program_clauses(tcx);

src/librustc_typeck/check/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -702,9 +702,9 @@ fn typeck_item_bodies<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, crate_num: CrateNum
702702
{
703703
debug_assert!(crate_num == LOCAL_CRATE);
704704
Ok(tcx.sess.track_errors(|| {
705-
for body_owner_def_id in tcx.body_owners() {
705+
tcx.par_body_owners(|body_owner_def_id| {
706706
ty::query::queries::typeck_tables_of::ensure(tcx, body_owner_def_id);
707-
}
707+
});
708708
})?)
709709
}
710710

src/librustc_typeck/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ This API is completely unstable and subject to change.
8383
#![feature(slice_sort_by_cached_key)]
8484
#![feature(never_type)]
8585

86+
#![recursion_limit="256"]
87+
8688
#[macro_use] extern crate log;
8789
#[macro_use] extern crate syntax;
8890
extern crate syntax_pos;

0 commit comments

Comments
 (0)