about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2018-03-15 10:08:52 +0100
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2018-06-19 03:19:48 +0200
commitb5650f9282804f88dafa2d800ac9fae27765ddcd (patch)
tree1e6e7dd393bd29512524b53b5d4194d2cc05bbd4
parent6ee8e0fc112fbc126405a75dff0275dd50b1dbe4 (diff)
downloadrust-b5650f9282804f88dafa2d800ac9fae27765ddcd.tar.gz
rust-b5650f9282804f88dafa2d800ac9fae27765ddcd.zip
Parallel code
-rw-r--r--src/librustc_borrowck/borrowck/mod.rs4
-rw-r--r--src/librustc_borrowck/lib.rs2
-rw-r--r--src/librustc_driver/driver.rs8
-rw-r--r--src/librustc_typeck/check/mod.rs4
-rw-r--r--src/librustc_typeck/lib.rs2
5 files changed, 11 insertions, 9 deletions
diff --git a/src/librustc_borrowck/borrowck/mod.rs b/src/librustc_borrowck/borrowck/mod.rs
index 11d35def007..684fd10c8c6 100644
--- a/src/librustc_borrowck/borrowck/mod.rs
+++ b/src/librustc_borrowck/borrowck/mod.rs
@@ -67,9 +67,9 @@ pub struct LoanDataFlowOperator;
 pub type LoanDataFlow<'a, 'tcx> = DataFlowContext<'a, 'tcx, LoanDataFlowOperator>;
 
 pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
-    for body_owner_def_id in tcx.body_owners() {
+    tcx.par_body_owners(|body_owner_def_id| {
         tcx.borrowck(body_owner_def_id);
-    }
+    });
 }
 
 pub fn provide(providers: &mut Providers) {
diff --git a/src/librustc_borrowck/lib.rs b/src/librustc_borrowck/lib.rs
index 52a357e1a1d..a5a20af0e4e 100644
--- a/src/librustc_borrowck/lib.rs
+++ b/src/librustc_borrowck/lib.rs
@@ -17,6 +17,8 @@
 #![feature(from_ref)]
 #![feature(quote)]
 
+#![recursion_limit="256"]
+
 #[macro_use] extern crate log;
 extern crate syntax;
 extern crate syntax_pos;
diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs
index 5d5baf76549..c18a0892686 100644
--- a/src/librustc_driver/driver.rs
+++ b/src/librustc_driver/driver.rs
@@ -1272,11 +1272,9 @@ where
 
             time(sess, "borrow checking", || borrowck::check_crate(tcx));
 
-            time(sess, "MIR borrow checking", || {
-                for def_id in tcx.body_owners() {
-                    tcx.mir_borrowck(def_id);
-                }
-            });
+            time(sess,
+                 "MIR borrow checking",
+                 || tcx.par_body_owners(|def_id| { tcx.mir_borrowck(def_id); }));
 
             time(sess, "dumping chalk-like clauses", || {
                 rustc_traits::lowering::dump_program_clauses(tcx);
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs
index d68fc67073e..b70b61d1915 100644
--- a/src/librustc_typeck/check/mod.rs
+++ b/src/librustc_typeck/check/mod.rs
@@ -702,9 +702,9 @@ fn typeck_item_bodies<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, crate_num: CrateNum
 {
     debug_assert!(crate_num == LOCAL_CRATE);
     Ok(tcx.sess.track_errors(|| {
-        for body_owner_def_id in tcx.body_owners() {
+        tcx.par_body_owners(|body_owner_def_id| {
             ty::query::queries::typeck_tables_of::ensure(tcx, body_owner_def_id);
-        }
+        });
     })?)
 }
 
diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs
index ce7249bd7b5..80f57adf580 100644
--- a/src/librustc_typeck/lib.rs
+++ b/src/librustc_typeck/lib.rs
@@ -83,6 +83,8 @@ This API is completely unstable and subject to change.
 #![feature(slice_sort_by_cached_key)]
 #![feature(never_type)]
 
+#![recursion_limit="256"]
+
 #[macro_use] extern crate log;
 #[macro_use] extern crate syntax;
 extern crate syntax_pos;