diff --git a/Cargo.lock b/Cargo.lock index c62c379f70d7b..aedc121be75e1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -3545,6 +3545,8 @@ dependencies = [ "tempfile", "thin-vec", "tracing", + "triomphe", + "unsize", "windows", ] @@ -3908,6 +3910,7 @@ dependencies = [ "rustc_traits", "rustc_ty_utils", "tracing", + "unsize", ] [[package]] @@ -4359,6 +4362,7 @@ dependencies = [ "smallvec", "tempfile", "thin-vec", + "triomphe", ] [[package]] @@ -5465,6 +5469,16 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "triomphe" +version = "0.1.14" +source = "git+https://github.com/GnomedDev/triomphe?branch=dropck-eyepatch#a9614f96c0eb04818cea5f98416b05ca34d9e383" +dependencies = [ + "serde", + "stable_deref_trait", + "unsize", +] + [[package]] name = "twox-hash" version = "1.6.3" @@ -5661,6 +5675,15 @@ dependencies = [ "diff", ] +[[package]] +name = "unsize" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fa7a7a734c1a5664a662ddcea0b6c9472a21da8888c957c7f1eaa09dba7a939" +dependencies = [ + "autocfg", +] + [[package]] name = "unstable-book-gen" version = "0.1.0" @@ -5813,7 +5836,7 @@ dependencies = [ "lexopt", "tempfile", "wasi-preview1-component-adapter-provider", - "wasmparser 0.219.0", + "wasmparser 0.219.1", "wat", "wit-component", "wit-parser", @@ -5837,19 +5860,19 @@ dependencies = [ [[package]] name = "wasm-encoder" -version = "0.219.0" +version = "0.219.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b1b95711b3ad655656a341e301cc64e33cbee94de9a99a1c5a2ab88efab79d" +checksum = "29cbbd772edcb8e7d524a82ee8cef8dd046fc14033796a754c3ad246d019fa54" dependencies = [ "leb128", - "wasmparser 0.219.0", + "wasmparser 0.219.1", ] [[package]] name = "wasm-metadata" -version = "0.219.0" +version = "0.219.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96132fe00dd17d092d2be289eeed5a0a68ad3cf30b68e8875bc953b96f55f0be" +checksum = "2af5a8e37a5e996861e1813f8de30911c47609c9ff51a7284f7dbd754dc3a9f3" dependencies = [ "anyhow", "indexmap", @@ -5857,8 +5880,8 @@ dependencies = [ "serde_derive", "serde_json", "spdx", - "wasm-encoder 0.219.0", - "wasmparser 0.219.0", + "wasm-encoder 0.219.1", + "wasmparser 0.219.1", ] [[package]] @@ -5873,9 +5896,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.219.0" +version = "0.219.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "324b4e56d24439495b88cd81439dad5e97f3c7b1eedc3c7e10455ed1e045e9a2" +checksum = "5c771866898879073c53b565a6c7b49953795159836714ac56a5befb581227c5" dependencies = [ "ahash", "bitflags 2.6.0", @@ -5887,22 +5910,22 @@ dependencies = [ [[package]] name = "wast" -version = "219.0.0" +version = "219.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06880ecb25662bc21db6a83f4fcc27c41f71fbcba4f1980b650c88ada92728e1" +checksum = "4f79a9d9df79986a68689a6b40bcc8d5d40d807487b235bebc2ac69a242b54a1" dependencies = [ "bumpalo", "leb128", "memchr", "unicode-width", - "wasm-encoder 0.219.0", + "wasm-encoder 0.219.1", ] [[package]] name = "wat" -version = "1.219.0" +version = "1.219.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11e56dbf9fc89111b0d97c91e683d7895b1a6e5633a729f2ccad2303724005b6" +checksum = "8bc3cf014fb336883a411cd662f987abf6a1d2a27f2f0008616a0070bbf6bd0d" dependencies = [ "wast", ] @@ -6179,9 +6202,9 @@ dependencies = [ [[package]] name = "wit-component" -version = "0.219.0" +version = "0.219.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99a76111c20444a814019de20499d30940ecd219b9512ee296f034a5edb18a2d" +checksum = "ad1673163c0cb14a6a19ddbf44dd4efe6f015ec1ebb8156710ac32501f19fba2" dependencies = [ "anyhow", "bitflags 2.6.0", @@ -6190,17 +6213,17 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "wasm-encoder 0.219.0", + "wasm-encoder 0.219.1", "wasm-metadata", - "wasmparser 0.219.0", + "wasmparser 0.219.1", "wit-parser", ] [[package]] name = "wit-parser" -version = "0.219.0" +version = "0.219.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23102e180c0c464f36e293d31a27b524e3ece930d7b5527d2f33f9d2c963de64" +checksum = "4a86f669283257e8e424b9a4fc3518e3ade0b95deb9fbc0f93a1876be3eda598" dependencies = [ "anyhow", "id-arena", @@ -6211,7 +6234,7 @@ dependencies = [ "serde_derive", "serde_json", "unicode-xid", - "wasmparser 0.219.0", + "wasmparser 0.219.1", ] [[package]] diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index 263e4a9379f3a..426baedbeaf8c 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -192,17 +192,17 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { current_item: None, impl_trait_defs: Vec::new(), impl_trait_bounds: Vec::new(), - allow_try_trait: [sym::try_trait_v2, sym::yeet_desugar_details].into(), + allow_try_trait: [sym::try_trait_v2, sym::yeet_desugar_details].as_slice().into(), allow_gen_future: if tcx.features().async_fn_track_caller { - [sym::gen_future, sym::closure_track_caller].into() + [sym::gen_future, sym::closure_track_caller].as_slice().into() } else { - [sym::gen_future].into() + [sym::gen_future].as_slice().into() }, - allow_for_await: [sym::async_iterator].into(), - allow_async_fn_traits: [sym::async_fn_traits].into(), + allow_for_await: [sym::async_iterator].as_slice().into(), + allow_async_fn_traits: [sym::async_fn_traits].as_slice().into(), // FIXME(gen_blocks): how does `closure_track_caller`/`async_fn_track_caller` // interact with `gen`/`async gen` blocks - allow_async_iterator: [sym::gen_future, sym::async_iterator].into(), + allow_async_iterator: [sym::gen_future, sym::async_iterator].as_slice().into(), generics_def_id_map: Default::default(), host_param_id: None, ast_index, diff --git a/compiler/rustc_codegen_cranelift/src/global_asm.rs b/compiler/rustc_codegen_cranelift/src/global_asm.rs index 0c99a5ce12f6e..48186f0fb45ed 100644 --- a/compiler/rustc_codegen_cranelift/src/global_asm.rs +++ b/compiler/rustc_codegen_cranelift/src/global_asm.rs @@ -4,9 +4,9 @@ use std::io::Write; use std::path::PathBuf; use std::process::{Command, Stdio}; -use std::sync::Arc; use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece}; +use rustc_data_structures::sync::Lrc; use rustc_hir::{InlineAsmOperand, ItemId}; use rustc_middle::mir::interpret::ErrorHandled; use rustc_session::config::{OutputFilenames, OutputType}; @@ -110,7 +110,7 @@ pub(crate) fn codegen_global_asm_item(tcx: TyCtxt<'_>, global_asm: &mut String, pub(crate) struct GlobalAsmConfig { assembler: PathBuf, target: String, - pub(crate) output_filenames: Arc, + pub(crate) output_filenames: Lrc, } impl GlobalAsmConfig { diff --git a/compiler/rustc_codegen_cranelift/src/lib.rs b/compiler/rustc_codegen_cranelift/src/lib.rs index b6f9ce8fc2988..5c7b48ba24be4 100644 --- a/compiler/rustc_codegen_cranelift/src/lib.rs +++ b/compiler/rustc_codegen_cranelift/src/lib.rs @@ -42,6 +42,7 @@ use cranelift_codegen::settings::{self, Configurable}; use rustc_codegen_ssa::CodegenResults; use rustc_codegen_ssa::traits::CodegenBackend; use rustc_data_structures::profiling::SelfProfilerRef; +use rustc_data_structures::sync::Lrc; use rustc_errors::ErrorGuaranteed; use rustc_metadata::EncodedMetadata; use rustc_middle::dep_graph::{WorkProduct, WorkProductId}; @@ -125,7 +126,7 @@ impl String> Drop for PrintOnPanic { /// inside a single codegen unit with the exception of the Cranelift [`Module`](cranelift_module::Module). struct CodegenCx { profiler: SelfProfilerRef, - output_filenames: Arc, + output_filenames: Lrc, should_write_ir: bool, global_asm: String, inline_asm_index: Cell, diff --git a/compiler/rustc_codegen_ssa/src/back/write.rs b/compiler/rustc_codegen_ssa/src/back/write.rs index e3d11cfaf4fe3..a9c5f71ea964a 100644 --- a/compiler/rustc_codegen_ssa/src/back/write.rs +++ b/compiler/rustc_codegen_ssa/src/back/write.rs @@ -44,7 +44,7 @@ use super::symbol_export::symbol_name_for_instance_in_crate; use crate::errors::ErrorCreatingRemarkDir; use crate::traits::*; use crate::{ - CachedModuleCodegen, CodegenResults, CompiledModule, CrateInfo, ModuleCodegen, ModuleKind, + CachedModuleCodegen, CodegenResults, CompiledModule, CrateInfo, Lrc, ModuleCodegen, ModuleKind, errors, }; @@ -349,7 +349,7 @@ pub struct CodegenContext { pub opts: Arc, pub crate_types: Vec, pub each_linked_rlib_for_lto: Vec<(CrateNum, PathBuf)>, - pub output_filenames: Arc, + pub output_filenames: Lrc, pub regular_module_config: Arc, pub metadata_module_config: Arc, pub allocator_module_config: Arc, @@ -2037,7 +2037,7 @@ pub struct OngoingCodegen { pub crate_info: CrateInfo, pub codegen_worker_receive: Receiver, pub shared_emitter_main: SharedEmitterMain, - pub output_filenames: Arc, + pub output_filenames: Lrc, pub coordinator: Coordinator, } diff --git a/compiler/rustc_data_structures/Cargo.toml b/compiler/rustc_data_structures/Cargo.toml index d73cf11ee64d6..8953254056d77 100644 --- a/compiler/rustc_data_structures/Cargo.toml +++ b/compiler/rustc_data_structures/Cargo.toml @@ -26,11 +26,19 @@ stacker = "0.1.17" tempfile = "3.2" thin-vec = "0.2.12" tracing = "0.1" +unsize = { version = "1.1", optional = true } # tidy-alphabetical-end [dependencies.parking_lot] version = "0.12" +[dependencies.triomphe] +version = "0.1" +optional = true +features = ["unsize", "unstable_dropck_eyepatch"] +git = "https://github.com/GnomedDev/triomphe" +branch = "dropck-eyepatch" + [target.'cfg(windows)'.dependencies.windows] version = "0.57.0" features = [ @@ -56,5 +64,5 @@ portable-atomic = "1.5.1" [features] # tidy-alphabetical-start -rustc_use_parallel_compiler = ["indexmap/rustc-rayon", "dep:rustc-rayon"] +rustc_use_parallel_compiler = ["indexmap/rustc-rayon", "dep:rustc-rayon", "dep:triomphe", "dep:unsize"] # tidy-alphabetical-end diff --git a/compiler/rustc_data_structures/src/marker.rs b/compiler/rustc_data_structures/src/marker.rs index 83fdaff515b03..f854ecfbdea6b 100644 --- a/compiler/rustc_data_structures/src/marker.rs +++ b/compiler/rustc_data_structures/src/marker.rs @@ -42,7 +42,6 @@ cfg_match! { [*mut T where T: ?Sized] [std::ptr::NonNull where T: ?Sized] [std::rc::Rc where T: ?Sized] - [std::rc::Weak where T: ?Sized] [std::sync::MutexGuard<'_, T> where T: ?Sized] [std::sync::RwLockReadGuard<'_, T> where T: ?Sized] [std::sync::RwLockWriteGuard<'_, T> where T: ?Sized] @@ -92,6 +91,7 @@ cfg_match! { [Box where T: ?Sized + DynSend, A: std::alloc::Allocator + DynSend] [crate::sync::RwLock where T: DynSend] [crate::tagged_ptr::CopyTaggedPtr where P: Send + crate::tagged_ptr::Pointer, T: Send + crate::tagged_ptr::Tag, const CP: bool] + [triomphe::Arc where T: ?Sized + DynSync + DynSend] [rustc_arena::TypedArena where T: DynSend] [indexmap::IndexSet where V: DynSend, S: DynSend] [indexmap::IndexMap where K: DynSend, V: DynSend, S: DynSend] @@ -116,7 +116,6 @@ cfg_match! { [std::cell::UnsafeCell where T: ?Sized] [std::ptr::NonNull where T: ?Sized] [std::rc::Rc where T: ?Sized] - [std::rc::Weak where T: ?Sized] [std::cell::OnceCell where T] [std::sync::mpsc::Receiver where T] [std::sync::mpsc::Sender where T] @@ -179,6 +178,7 @@ cfg_match! { [crate::sync::WorkerLocal where T: DynSend] [crate::intern::Interned<'a, T> where 'a, T: DynSync] [crate::tagged_ptr::CopyTaggedPtr where P: Sync + crate::tagged_ptr::Pointer, T: Sync + crate::tagged_ptr::Tag, const CP: bool] + [triomphe::Arc where T: ?Sized + DynSync + DynSend] [parking_lot::lock_api::Mutex where R: DynSync, T: ?Sized + DynSend] [parking_lot::lock_api::RwLock where R: DynSync, T: ?Sized + DynSend + DynSync] [indexmap::IndexSet where V: DynSync, S: DynSync] diff --git a/compiler/rustc_data_structures/src/owned_slice.rs b/compiler/rustc_data_structures/src/owned_slice.rs index bbe6691e548d0..e5e655c4ebcfe 100644 --- a/compiler/rustc_data_structures/src/owned_slice.rs +++ b/compiler/rustc_data_structures/src/owned_slice.rs @@ -1,6 +1,8 @@ use std::borrow::Borrow; use std::ops::Deref; +use unsize::{CoerceUnsize, Coercion}; + // Use our fake Send/Sync traits when on not parallel compiler, // so that `OwnedSlice` only implements/requires Send/Sync // for parallel compiler builds. @@ -89,7 +91,8 @@ where let owner = Lrc::new(owner); let bytes = slicer(&*owner)?; - Ok(OwnedSlice { bytes, owner }) + let owner_unsized = owner.clone().unsize(Coercion!(to dyn sync::Send + sync::Sync)); + Ok(OwnedSlice { bytes, owner: owner_unsized }) } impl OwnedSlice { diff --git a/compiler/rustc_data_structures/src/stable_hasher.rs b/compiler/rustc_data_structures/src/stable_hasher.rs index 0872bd2c9acc9..e464cc4306280 100644 --- a/compiler/rustc_data_structures/src/stable_hasher.rs +++ b/compiler/rustc_data_structures/src/stable_hasher.rs @@ -381,14 +381,7 @@ impl, CTX> HashStable for Box { } } -impl, CTX> HashStable for ::std::rc::Rc { - #[inline] - fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher) { - (**self).hash_stable(ctx, hasher); - } -} - -impl, CTX> HashStable for ::std::sync::Arc { +impl, CTX> HashStable for crate::sync::Lrc { #[inline] fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher) { (**self).hash_stable(ctx, hasher); diff --git a/compiler/rustc_data_structures/src/sync.rs b/compiler/rustc_data_structures/src/sync.rs index a3491dbfec7d4..f5544443f5330 100644 --- a/compiler/rustc_data_structures/src/sync.rs +++ b/compiler/rustc_data_structures/src/sync.rs @@ -199,7 +199,6 @@ cfg_match! { pub type AtomicU64 = Atomic; pub use std::rc::Rc as Lrc; - pub use std::rc::Weak as Weak; #[doc(no_inline)] pub use std::cell::Ref as ReadGuard; #[doc(no_inline)] @@ -277,8 +276,7 @@ cfg_match! { #[cfg(not(target_has_atomic = "64"))] pub use portable_atomic::AtomicU64; - pub use std::sync::Arc as Lrc; - pub use std::sync::Weak as Weak; + pub use triomphe::Arc as Lrc; pub type LRef<'a, T> = &'a T; diff --git a/compiler/rustc_interface/Cargo.toml b/compiler/rustc_interface/Cargo.toml index b5abf145d6b5b..5925170386bd9 100644 --- a/compiler/rustc_interface/Cargo.toml +++ b/compiler/rustc_interface/Cargo.toml @@ -49,6 +49,7 @@ rustc_trait_selection = { path = "../rustc_trait_selection" } rustc_traits = { path = "../rustc_traits" } rustc_ty_utils = { path = "../rustc_ty_utils" } tracing = "0.1" +unsize = "1.1" # tidy-alphabetical-end [features] @@ -58,6 +59,6 @@ rustc_use_parallel_compiler = [ 'dep:rustc-rayon', 'dep:rustc-rayon-core', 'rustc_query_impl/rustc_use_parallel_compiler', - 'rustc_errors/rustc_use_parallel_compiler' + 'rustc_errors/rustc_use_parallel_compiler', ] # tidy-alphabetical-end diff --git a/compiler/rustc_interface/src/interface.rs b/compiler/rustc_interface/src/interface.rs index 3920d3077d361..9624074943d6d 100644 --- a/compiler/rustc_interface/src/interface.rs +++ b/compiler/rustc_interface/src/interface.rs @@ -21,11 +21,12 @@ use rustc_query_system::query::print_query_stack; use rustc_session::config::{self, Cfg, CheckCfg, ExpectedValues, Input, OutFileName}; use rustc_session::filesearch::{self, sysroot_candidates}; use rustc_session::parse::ParseSess; -use rustc_session::{CompilerIO, EarlyDiagCtxt, Session, lint}; +use rustc_session::{CompilerIO, EarlyDiagCtxt, LintStoreMarker, Session, lint}; use rustc_span::FileName; use rustc_span::source_map::{FileLoader, RealFileLoader, SourceMapInputs}; use rustc_span::symbol::sym; use tracing::trace; +use unsize::{CoerceUnsize, Coercion}; use crate::util; @@ -481,7 +482,8 @@ pub fn run_compiler(config: Config, f: impl FnOnce(&Compiler) -> R + Se register_lints(&sess, &mut lint_store); sess.registered_lints = true; } - sess.lint_store = Some(Lrc::new(lint_store)); + + sess.lint_store = Some(Lrc::new(lint_store).unsize(Coercion!(to dyn LintStoreMarker))); let compiler = Compiler { sess, diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index fd850d2f39a5f..7667e7fa5a967 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -2,7 +2,7 @@ use std::any::Any; use std::ffi::OsString; use std::io::{self, BufWriter, Write}; use std::path::{Path, PathBuf}; -use std::sync::{Arc, LazyLock}; +use std::sync::LazyLock; use std::{env, fs, iter}; use rustc_ast::{self as ast, visit}; @@ -811,7 +811,7 @@ pub(crate) fn create_global_ctxt<'tcx>( crate_name, ))); feed.crate_for_resolver(tcx.arena.alloc(Steal::new((krate, pre_configured_attrs)))); - feed.output_filenames(Arc::new(outputs)); + feed.output_filenames(Lrc::new(outputs)); }); Ok(qcx) }) diff --git a/compiler/rustc_interface/src/queries.rs b/compiler/rustc_interface/src/queries.rs index 3a1833452d4b6..873371f8c0476 100644 --- a/compiler/rustc_interface/src/queries.rs +++ b/compiler/rustc_interface/src/queries.rs @@ -1,13 +1,12 @@ use std::any::Any; use std::cell::{RefCell, RefMut}; -use std::sync::Arc; use rustc_ast as ast; use rustc_codegen_ssa::CodegenResults; use rustc_codegen_ssa::traits::CodegenBackend; use rustc_data_structures::steal::Steal; use rustc_data_structures::svh::Svh; -use rustc_data_structures::sync::{OnceLock, WorkerLocal}; +use rustc_data_structures::sync::{Lrc, OnceLock, WorkerLocal}; use rustc_hir::def_id::LOCAL_CRATE; use rustc_middle::arena::Arena; use rustc_middle::dep_graph::DepGraph; @@ -115,7 +114,7 @@ impl<'tcx> Queries<'tcx> { pub struct Linker { dep_graph: DepGraph, - output_filenames: Arc, + output_filenames: Lrc, // Only present when incr. comp. is enabled. crate_hash: Option, ongoing_codegen: Box, diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs index f0be70e00dfca..44c4a07aff20e 100644 --- a/compiler/rustc_middle/src/query/mod.rs +++ b/compiler/rustc_middle/src/query/mod.rs @@ -9,7 +9,6 @@ use std::mem; use std::ops::Deref; use std::path::PathBuf; -use std::sync::Arc; use rustc_arena::TypedArena; use rustc_ast::expand::StrippedCfgItem; @@ -1993,7 +1992,7 @@ rustc_queries! { /// /// This query returns an `&Arc` because codegen backends need the value even after the `TyCtxt` /// has been destroyed. - query output_filenames(_: ()) -> &'tcx Arc { + query output_filenames(_: ()) -> &'tcx Lrc { feedable desc { "getting output filenames" } arena_cache diff --git a/compiler/rustc_query_impl/Cargo.toml b/compiler/rustc_query_impl/Cargo.toml index 2bb1be22b985d..dce3d28e0629d 100644 --- a/compiler/rustc_query_impl/Cargo.toml +++ b/compiler/rustc_query_impl/Cargo.toml @@ -22,5 +22,8 @@ tracing = "0.1" [features] # tidy-alphabetical-start -rustc_use_parallel_compiler = ["rustc_query_system/rustc_use_parallel_compiler"] +rustc_use_parallel_compiler = [ + "rustc_query_system/rustc_use_parallel_compiler", + "rustc_serialize/rustc_use_parallel_compiler", +] # tidy-alphabetical-end diff --git a/compiler/rustc_serialize/Cargo.toml b/compiler/rustc_serialize/Cargo.toml index 8bf98c16361eb..d25bd3b3feae9 100644 --- a/compiler/rustc_serialize/Cargo.toml +++ b/compiler/rustc_serialize/Cargo.toml @@ -10,8 +10,18 @@ smallvec = { version = "1.8.1", features = ["union", "may_dangle"] } thin-vec = "0.2.12" # tidy-alphabetical-end +[dependencies.triomphe] +version = "0.1" +optional = true +features = ["unsize", "unstable_dropck_eyepatch"] +git = "https://github.com/GnomedDev/triomphe" +branch = "dropck-eyepatch" + [dev-dependencies] # tidy-alphabetical-start rustc_macros = { path = "../rustc_macros" } tempfile = "3.2" # tidy-alphabetical-end + +[features] +rustc_use_parallel_compiler = ["dep:triomphe"] diff --git a/compiler/rustc_serialize/src/serialize.rs b/compiler/rustc_serialize/src/serialize.rs index bae5f259fccf4..c1eb43752d5ff 100644 --- a/compiler/rustc_serialize/src/serialize.rs +++ b/compiler/rustc_serialize/src/serialize.rs @@ -8,7 +8,6 @@ use std::marker::PhantomData; use std::num::NonZero; use std::path; use std::rc::Rc; -use std::sync::Arc; use smallvec::{Array, SmallVec}; use thin_vec::ThinVec; @@ -474,15 +473,17 @@ impl> Decodable for RefCell { } } -impl> Encodable for Arc { +#[cfg(parallel_compiler)] +impl> Encodable for triomphe::Arc { fn encode(&self, s: &mut S) { (**self).encode(s); } } -impl> Decodable for Arc { - fn decode(d: &mut D) -> Arc { - Arc::new(Decodable::decode(d)) +#[cfg(parallel_compiler)] +impl> Decodable for triomphe::Arc { + fn decode(d: &mut D) -> triomphe::Arc { + triomphe::Arc::new(Decodable::decode(d)) } } @@ -703,15 +704,17 @@ impl> Decodable for Rc<[T]> { } } -impl> Encodable for Arc<[T]> { +#[cfg(parallel_compiler)] +impl> Encodable for triomphe::Arc<[T]> { fn encode(&self, s: &mut E) { let slice: &[T] = self; slice.encode(s); } } -impl> Decodable for Arc<[T]> { - fn decode(d: &mut D) -> Arc<[T]> { +#[cfg(parallel_compiler)] +impl> Decodable for triomphe::Arc<[T]> { + fn decode(d: &mut D) -> triomphe::Arc<[T]> { let vec: Vec = Decodable::decode(d); vec.into() } diff --git a/src/tools/tidy/src/deps.rs b/src/tools/tidy/src/deps.rs index 5163f039a2329..e96848243b3bf 100644 --- a/src/tools/tidy/src/deps.rs +++ b/src/tools/tidy/src/deps.rs @@ -417,6 +417,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[ "tracing-log", "tracing-subscriber", "tracing-tree", + "triomphe", "twox-hash", "type-map", "typenum", @@ -432,6 +433,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[ "unicode-security", "unicode-width", "unicode-xid", + "unsize", "valuable", "version_check", "wasi", diff --git a/src/tools/tidy/src/extdeps.rs b/src/tools/tidy/src/extdeps.rs index 55f937aeacf50..4572b4fa8251e 100644 --- a/src/tools/tidy/src/extdeps.rs +++ b/src/tools/tidy/src/extdeps.rs @@ -8,6 +8,7 @@ const ALLOWED_SOURCES: &[&str] = &[ r#""registry+https://github.com/rust-lang/crates.io-index""#, // This is `rust_team_data` used by `site` in src/tools/rustc-perf, r#""git+https://github.com/rust-lang/team#a5260e76d3aa894c64c56e6ddc8545b9a98043ec""#, + r#""git+https://github.com/GnomedDev/triomphe?branch=dropck-eyepatch#a9614f96c0eb04818cea5f98416b05ca34d9e383""#, ]; /// Checks for external package sources. `root` is the path to the directory that contains the