Skip to content

Commit 970c613

Browse files
committed
Add sync module to rustc_data_structures
1 parent 53a6d14 commit 970c613

File tree

24 files changed

+2391
-19
lines changed

24 files changed

+2391
-19
lines changed

src/Cargo.lock

+33-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/bootstrap/bin/rustc.rs

+4
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,10 @@ fn main() {
265265
}
266266
}
267267

268+
if env::var_os("RUSTC_PARALLEL_QUERIES").is_some() {
269+
cmd.arg("--cfg").arg("parallel_queries");
270+
}
271+
268272
let color = match env::var("RUSTC_COLOR") {
269273
Ok(s) => usize::from_str(&s).expect("RUSTC_COLOR should be an integer"),
270274
Err(_) => 0,

src/bootstrap/compile.rs

+3
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,9 @@ pub fn rustc_cargo(build: &Build,
561561
if let Some(ref s) = build.config.rustc_default_linker {
562562
cargo.env("CFG_DEFAULT_LINKER", s);
563563
}
564+
if build.config.rustc_parallel_queries {
565+
cargo.env("RUSTC_PARALLEL_QUERIES", "1");
566+
}
564567
}
565568

566569
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]

src/bootstrap/config.rs

+3
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ pub struct Config {
8787
pub rust_debuginfo_lines: bool,
8888
pub rust_debuginfo_only_std: bool,
8989
pub rust_rpath: bool,
90+
pub rustc_parallel_queries: bool,
9091
pub rustc_default_linker: Option<String>,
9192
pub rust_optimize_tests: bool,
9293
pub rust_debuginfo_tests: bool,
@@ -266,6 +267,7 @@ struct Rust {
266267
debuginfo: Option<bool>,
267268
debuginfo_lines: Option<bool>,
268269
debuginfo_only_std: Option<bool>,
270+
experimental_parallel_queries: Option<bool>,
269271
debug_jemalloc: Option<bool>,
270272
use_jemalloc: Option<bool>,
271273
backtrace: Option<bool>,
@@ -474,6 +476,7 @@ impl Config {
474476
set(&mut config.rust_dist_src, rust.dist_src);
475477
set(&mut config.quiet_tests, rust.quiet_tests);
476478
set(&mut config.test_miri, rust.test_miri);
479+
config.rustc_parallel_queries = rust.experimental_parallel_queries.unwrap_or(false);
477480
config.rustc_default_linker = rust.default_linker.clone();
478481
config.musl_root = rust.musl_root.clone().map(PathBuf::from);
479482
config.save_toolstates = rust.save_toolstates.clone().map(PathBuf::from);

src/librustc/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ fmt_macros = { path = "../libfmt_macros" }
1515
graphviz = { path = "../libgraphviz" }
1616
jobserver = "0.1"
1717
log = "0.3"
18-
owning_ref = "0.3.3"
1918
rustc_apfloat = { path = "../librustc_apfloat" }
2019
rustc_back = { path = "../librustc_back" }
2120
rustc_const_math = { path = "../librustc_const_math" }

src/librustc/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ extern crate getopts;
7777
extern crate graphviz;
7878
#[cfg(windows)]
7979
extern crate libc;
80-
extern crate owning_ref;
8180
extern crate rustc_back;
8281
#[macro_use] extern crate rustc_data_structures;
8382
extern crate serialize;

src/librustc/middle/cstore.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use std::any::Any;
3838
use std::collections::BTreeMap;
3939
use std::path::{Path, PathBuf};
4040
use std::rc::Rc;
41-
use owning_ref::ErasedBoxRef;
41+
use rustc_data_structures::owning_ref::ErasedBoxRef;
4242
use syntax::ast;
4343
use syntax::ext::base::SyntaxExtension;
4444
use syntax::symbol::Symbol;

src/librustc_data_structures/Cargo.toml

+7
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,10 @@ crate-type = ["dylib"]
1111
[dependencies]
1212
log = "0.3"
1313
serialize = { path = "../libserialize" }
14+
cfg-if = "0.1.2"
15+
stable_deref_trait = "1.0.0"
16+
parking_lot_core = "0.2.8"
17+
18+
[dependencies.parking_lot]
19+
version = "0.5"
20+
features = ["nightly"]

src/librustc_data_structures/lib.rs

+9
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@
3131
#![feature(i128)]
3232
#![feature(conservative_impl_trait)]
3333
#![feature(specialization)]
34+
#![feature(optin_builtin_traits)]
3435
#![feature(underscore_lifetimes)]
36+
#![feature(macro_vis_matcher)]
37+
#![feature(allow_internal_unstable)]
3538

3639
#![cfg_attr(unix, feature(libc))]
3740
#![cfg_attr(test, feature(test))]
@@ -42,6 +45,10 @@ extern crate log;
4245
extern crate serialize as rustc_serialize; // used by deriving
4346
#[cfg(unix)]
4447
extern crate libc;
48+
extern crate parking_lot;
49+
#[macro_use]
50+
extern crate cfg_if;
51+
extern crate stable_deref_trait;
4552

4653
pub use rustc_serialize::hex::ToHex;
4754

@@ -67,6 +74,8 @@ pub mod tuple_slice;
6774
pub mod veccell;
6875
pub mod control_flow_graph;
6976
pub mod flock;
77+
pub mod sync;
78+
pub mod owning_ref;
7079

7180
// See comments in src/librustc/lib.rs
7281
#[doc(hidden)]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015 Marvin Löbel
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)