Skip to content

Commit 3df1996

Browse files
committed
Add Sync bounds to the crate store
1 parent 6968f4c commit 3df1996

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

src/librustc/middle/cstore.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use syntax::ext::base::SyntaxExtension;
3838
use syntax::symbol::Symbol;
3939
use syntax_pos::Span;
4040
use rustc_target::spec::Target;
41-
use rustc_data_structures::sync::{MetadataRef, Lrc};
41+
use rustc_data_structures::sync::{self, MetadataRef, Lrc};
4242

4343
pub use self::NativeLibraryKind::*;
4444

@@ -255,6 +255,8 @@ pub trait CrateStore {
255255
fn metadata_encoding_version(&self) -> &[u8];
256256
}
257257

258+
pub type CrateStoreDyn = CrateStore + sync::Sync;
259+
258260
// FIXME: find a better place for this?
259261
pub fn validate_crate_name(sess: Option<&Session>, s: &str, sp: Option<Span>) {
260262
let mut err_count = 0;

src/librustc/ty/context.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use lint::{self, Lint};
2626
use ich::{StableHashingContext, NodeIdHashingMode};
2727
use infer::canonical::{CanonicalVarInfo, CanonicalVarInfos};
2828
use infer::outlives::free_region_map::FreeRegionMap;
29-
use middle::cstore::{CrateStore, LinkMeta};
29+
use middle::cstore::{CrateStoreDyn, LinkMeta};
3030
use middle::cstore::EncodedMetadata;
3131
use middle::lang_items;
3232
use middle::resolve_lifetime::{self, ObjectLifetimeDefault};
@@ -852,7 +852,7 @@ pub struct GlobalCtxt<'tcx> {
852852
global_arenas: &'tcx GlobalArenas<'tcx>,
853853
global_interners: CtxtInterners<'tcx>,
854854

855-
cstore: &'tcx dyn CrateStore,
855+
cstore: &'tcx CrateStoreDyn,
856856

857857
pub sess: &'tcx Session,
858858

@@ -1188,7 +1188,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
11881188
/// value (types, substs, etc.) can only be used while `ty::tls` has a valid
11891189
/// reference to the context, to allow formatting values that need it.
11901190
pub fn create_and_enter<F, R>(s: &'tcx Session,
1191-
cstore: &'tcx dyn CrateStore,
1191+
cstore: &'tcx CrateStoreDyn,
11921192
local_providers: ty::maps::Providers<'tcx>,
11931193
extern_providers: ty::maps::Providers<'tcx>,
11941194
arenas: &'tcx AllArenas<'tcx>,

src/librustc_driver/driver.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use rustc::session::config::{self, Input, OutputFilenames, OutputType};
2020
use rustc::session::search_paths::PathKind;
2121
use rustc::lint;
2222
use rustc::middle::{self, reachable, resolve_lifetime, stability};
23-
use rustc::middle::cstore::CrateStore;
23+
use rustc::middle::cstore::CrateStoreDyn;
2424
use rustc::middle::privacy::AccessLevels;
2525
use rustc::ty::{self, AllArenas, Resolutions, TyCtxt};
2626
use rustc::traits;
@@ -1047,7 +1047,7 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(
10471047
trans: &TransCrate,
10481048
control: &CompileController,
10491049
sess: &'tcx Session,
1050-
cstore: &'tcx CrateStore,
1050+
cstore: &'tcx CrateStoreDyn,
10511051
hir_map: hir_map::Map<'tcx>,
10521052
mut analysis: ty::CrateAnalysis,
10531053
resolutions: Resolutions,

src/librustc_driver/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
#![feature(rustc_stack_internals)]
2828
#![feature(no_debug)]
2929

30+
#![recursion_limit="256"]
31+
3032
extern crate arena;
3133
extern crate getopts;
3234
extern crate graphviz;

src/librustc_driver/pretty.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use {abort_on_err, driver};
2020
use rustc::ty::{self, TyCtxt, Resolutions, AllArenas};
2121
use rustc::cfg;
2222
use rustc::cfg::graphviz::LabelledCFG;
23-
use rustc::middle::cstore::CrateStore;
23+
use rustc::middle::cstore::CrateStoreDyn;
2424
use rustc::session::Session;
2525
use rustc::session::config::{Input, OutputFilenames};
2626
use rustc_borrowck as borrowck;
@@ -199,7 +199,7 @@ impl PpSourceMode {
199199
}
200200
fn call_with_pp_support_hir<'tcx, A, F>(&self,
201201
sess: &'tcx Session,
202-
cstore: &'tcx CrateStore,
202+
cstore: &'tcx CrateStoreDyn,
203203
hir_map: &hir_map::Map<'tcx>,
204204
analysis: &ty::CrateAnalysis,
205205
resolutions: &Resolutions,
@@ -912,7 +912,7 @@ pub fn print_after_parsing(sess: &Session,
912912
}
913913

914914
pub fn print_after_hir_lowering<'tcx, 'a: 'tcx>(sess: &'a Session,
915-
cstore: &'tcx CrateStore,
915+
cstore: &'tcx CrateStoreDyn,
916916
hir_map: &hir_map::Map<'tcx>,
917917
analysis: &ty::CrateAnalysis,
918918
resolutions: &Resolutions,
@@ -1068,7 +1068,7 @@ pub fn print_after_hir_lowering<'tcx, 'a: 'tcx>(sess: &'a Session,
10681068
// with a different callback than the standard driver, so that isn't easy.
10691069
// Instead, we call that function ourselves.
10701070
fn print_with_analysis<'tcx, 'a: 'tcx>(sess: &'a Session,
1071-
cstore: &'a CrateStore,
1071+
cstore: &'a CrateStoreDyn,
10721072
hir_map: &hir_map::Map<'tcx>,
10731073
analysis: &ty::CrateAnalysis,
10741074
resolutions: &Resolutions,

0 commit comments

Comments
 (0)