Skip to content

Commit 8be2a04

Browse files
committed
pacify the parallel compiler
1 parent b592359 commit 8be2a04

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/librustc/ty/context.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ use crate::ty::{ExistentialPredicate, InferTy, ParamTy, PolyFnSig, Predicate, Pr
4141
use crate::ty::{InferConst, ParamConst};
4242
use crate::ty::{List, TyKind, TyS};
4343
use crate::util::common::ErrorReported;
44+
use rustc_data_structures::sync;
4445
use rustc_hir as hir;
4546
use rustc_hir::def::{DefKind, Res};
4647
use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, DefIdSet, DefIndex, LOCAL_CRATE};
@@ -951,7 +952,7 @@ pub struct GlobalCtxt<'tcx> {
951952
///
952953
/// FIXME(Centril): consider `dyn LintStoreMarker` once
953954
/// we can upcast to `Any` for some additional type safety.
954-
pub lint_store: Lrc<dyn Any>,
955+
pub lint_store: Lrc<dyn Any + sync::Sync + sync::Send>,
955956

956957
pub dep_graph: DepGraph,
957958

@@ -1120,7 +1121,7 @@ impl<'tcx> TyCtxt<'tcx> {
11201121
/// reference to the context, to allow formatting values that need it.
11211122
pub fn create_global_ctxt(
11221123
s: &'tcx Session,
1123-
lint_store: Lrc<dyn Any>,
1124+
lint_store: Lrc<dyn Any + sync::Send + sync::Sync>,
11241125
local_providers: ty::query::Providers<'tcx>,
11251126
extern_providers: ty::query::Providers<'tcx>,
11261127
arenas: &'tcx AllArenas,

src/librustc_lint/late.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@ use syntax::ast;
2828
use syntax::walk_list;
2929

3030
use log::debug;
31+
use std::any::Any;
3132
use std::slice;
3233

3334
/// Extract the `LintStore` from the query context.
3435
/// This function exists because we've erased `LintStore` as `dyn Any` in the context.
3536
crate fn unerased_lint_store<'tcx>(tcx: TyCtxt<'tcx>) -> &'tcx LintStore {
36-
tcx.lint_store.downcast_ref().unwrap()
37+
let store: &dyn Any = &*tcx.lint_store;
38+
store.downcast_ref().unwrap()
3739
}
3840

3941
macro_rules! lint_callback { ($cx:expr, $f:ident, $($args:expr),*) => ({

0 commit comments

Comments
 (0)