about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2020-01-09 09:40:55 +0100
committerMazdak Farrokhzad <twingoow@gmail.com>2020-01-11 07:42:26 +0100
commit8be2a04c7e6bf78a614840dc7152990a451ac4e0 (patch)
tree60fb8431493a0ebd0882a2784935a6a7e2728b49
parentb59235975e43ef5f3ea9436a62f4f07ee5b9a63e (diff)
downloadrust-8be2a04c7e6bf78a614840dc7152990a451ac4e0.tar.gz
rust-8be2a04c7e6bf78a614840dc7152990a451ac4e0.zip
pacify the parallel compiler
-rw-r--r--src/librustc/ty/context.rs5
-rw-r--r--src/librustc_lint/late.rs4
2 files changed, 6 insertions, 3 deletions
diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs
index c28631b9825..99e6c62f613 100644
--- a/src/librustc/ty/context.rs
+++ b/src/librustc/ty/context.rs
@@ -41,6 +41,7 @@ use crate::ty::{ExistentialPredicate, InferTy, ParamTy, PolyFnSig, Predicate, Pr
 use crate::ty::{InferConst, ParamConst};
 use crate::ty::{List, TyKind, TyS};
 use crate::util::common::ErrorReported;
+use rustc_data_structures::sync;
 use rustc_hir as hir;
 use rustc_hir::def::{DefKind, Res};
 use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, DefIdSet, DefIndex, LOCAL_CRATE};
@@ -951,7 +952,7 @@ pub struct GlobalCtxt<'tcx> {
     ///
     /// FIXME(Centril): consider `dyn LintStoreMarker` once
     /// we can upcast to `Any` for some additional type safety.
-    pub lint_store: Lrc<dyn Any>,
+    pub lint_store: Lrc<dyn Any + sync::Sync + sync::Send>,
 
     pub dep_graph: DepGraph,
 
@@ -1120,7 +1121,7 @@ impl<'tcx> TyCtxt<'tcx> {
     /// reference to the context, to allow formatting values that need it.
     pub fn create_global_ctxt(
         s: &'tcx Session,
-        lint_store: Lrc<dyn Any>,
+        lint_store: Lrc<dyn Any + sync::Send + sync::Sync>,
         local_providers: ty::query::Providers<'tcx>,
         extern_providers: ty::query::Providers<'tcx>,
         arenas: &'tcx AllArenas,
diff --git a/src/librustc_lint/late.rs b/src/librustc_lint/late.rs
index eb5f89c9507..30a37883775 100644
--- a/src/librustc_lint/late.rs
+++ b/src/librustc_lint/late.rs
@@ -28,12 +28,14 @@ use syntax::ast;
 use syntax::walk_list;
 
 use log::debug;
+use std::any::Any;
 use std::slice;
 
 /// Extract the `LintStore` from the query context.
 /// This function exists because we've erased `LintStore` as `dyn Any` in the context.
 crate fn unerased_lint_store<'tcx>(tcx: TyCtxt<'tcx>) -> &'tcx LintStore {
-    tcx.lint_store.downcast_ref().unwrap()
+    let store: &dyn Any = &*tcx.lint_store;
+    store.downcast_ref().unwrap()
 }
 
 macro_rules! lint_callback { ($cx:expr, $f:ident, $($args:expr),*) => ({