Parallel rustc needs synchronizing smart pointer cloning

This commit is contained in:
Oliver Scherer 2019-02-08 10:21:21 +01:00
parent b0cf52f6a5
commit bbe524d7c1
3 changed files with 7 additions and 7 deletions

View File

@ -44,6 +44,7 @@ use crate::middle::cstore::CrateStore;
use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::indexed_vec::IndexVec;
use rustc_data_structures::thin_vec::ThinVec;
use rustc_data_structures::sync::Lrc;
use crate::session::Session;
use crate::session::config::nightly_options;
use crate::util::common::FN_OUTPUT_NAME;
@ -52,7 +53,6 @@ use crate::util::nodemap::{DefIdMap, NodeMap};
use std::collections::{BTreeSet, BTreeMap};
use std::fmt::Debug;
use std::mem;
use std::rc::Rc;
use smallvec::SmallVec;
use syntax::attr;
use syntax::ast;
@ -688,7 +688,7 @@ impl<'a> LoweringContext<'a> {
&self,
reason: CompilerDesugaringKind,
span: Span,
allow_internal_unstable: Option<Rc<[Symbol]>>,
allow_internal_unstable: Option<Lrc<[Symbol]>>,
) -> Span {
let mark = Mark::fresh(Mark::root());
mark.set_expn_info(source_map::ExpnInfo {

View File

@ -622,7 +622,7 @@ pub enum SyntaxExtension {
ProcMacro {
expander: Box<dyn ProcMacro + sync::Sync + sync::Send>,
/// Whitelist of unstable features that are treated as stable inside this macro
allow_internal_unstable: Option<Rc<[Symbol]>>,
allow_internal_unstable: Option<Lrc<[Symbol]>>,
edition: Edition,
},
@ -642,7 +642,7 @@ pub enum SyntaxExtension {
/// directly use `#[unstable]` things.
///
/// Only allows things that require a feature gate in the given whitelist
allow_internal_unstable: Option<Rc<[Symbol]>>,
allow_internal_unstable: Option<Lrc<[Symbol]>>,
/// Whether the contents of the macro can use `unsafe`
/// without triggering the `unsafe_code` lint.
allow_internal_unsafe: bool,
@ -660,7 +660,7 @@ pub enum SyntaxExtension {
IdentTT {
expander: Box<dyn IdentMacroExpander + sync::Sync + sync::Send>,
span: Option<Span>,
allow_internal_unstable: Option<Rc<[Symbol]>>,
allow_internal_unstable: Option<Lrc<[Symbol]>>,
},
/// An attribute-like procedural macro. TokenStream -> TokenStream.

View File

@ -12,8 +12,8 @@ use crate::symbol::{keywords, Symbol};
use serialize::{Encodable, Decodable, Encoder, Decoder};
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::sync::Lrc;
use std::{fmt, mem};
use std::rc::Rc;
/// A SyntaxContext represents a chain of macro expansions (represented by marks).
#[derive(Clone, Copy, PartialEq, Eq, Default, PartialOrd, Ord, Hash)]
@ -554,7 +554,7 @@ pub struct ExpnInfo {
/// List of #[unstable]/feature-gated features that the macro is allowed to use
/// internally without forcing the whole crate to opt-in
/// to them.
pub allow_internal_unstable: Option<Rc<[Symbol]>>,
pub allow_internal_unstable: Option<Lrc<[Symbol]>>,
/// Whether the macro is allowed to use `unsafe` internally
/// even if the user crate has `#![forbid(unsafe_code)]`.
pub allow_internal_unsafe: bool,