diff options
| author | bors <bors@rust-lang.org> | 2025-02-06 10:50:05 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-02-06 10:50:05 +0000 |
| commit | 2f92f050e83bf3312ce4ba73c31fe843ad3cbc60 (patch) | |
| tree | ce6f75039ccafd2fa1dd5dbdeeff37233cb09d45 /compiler/rustc_errors/src/json.rs | |
| parent | 59588250ad973ce69bd15879314c9769e65f36b3 (diff) | |
| parent | 0a21f1d0a2fe9e84727a2de735fdcf55e8820db6 (diff) | |
| download | rust-2f92f050e83bf3312ce4ba73c31fe843ad3cbc60.tar.gz rust-2f92f050e83bf3312ce4ba73c31fe843ad3cbc60.zip | |
Auto merge of #136471 - safinaskar:parallel, r=SparrowLii
tree-wide: parallel: Fully removed all `Lrc`, replaced with `Arc`
tree-wide: parallel: Fully removed all `Lrc`, replaced with `Arc`
This is continuation of https://github.com/rust-lang/rust/pull/132282 .
I'm pretty sure I did everything right. In particular, I searched all occurrences of `Lrc` in submodules and made sure that they don't need replacement.
There are other possibilities, through.
We can define `enum Lrc<T> { Rc(Rc<T>), Arc(Arc<T>) }`. Or we can make `Lrc` a union and on every clone we can read from special thread-local variable. Or we can add a generic parameter to `Lrc` and, yes, this parameter will be everywhere across all codebase.
So, if you think we should take some alternative approach, then don't merge this PR. But if it is decided to stick with `Arc`, then, please, merge.
cc "Parallel Rustc Front-end" ( https://github.com/rust-lang/rust/issues/113349 )
r? SparrowLii
`@rustbot` label WG-compiler-parallel
Diffstat (limited to 'compiler/rustc_errors/src/json.rs')
| -rw-r--r-- | compiler/rustc_errors/src/json.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_errors/src/json.rs b/compiler/rustc_errors/src/json.rs index 95c81fc5f44..7d7f364fec2 100644 --- a/compiler/rustc_errors/src/json.rs +++ b/compiler/rustc_errors/src/json.rs @@ -16,7 +16,7 @@ use std::sync::{Arc, Mutex}; use std::vec; use derive_setters::Setters; -use rustc_data_structures::sync::{IntoDynSyncSend, Lrc}; +use rustc_data_structures::sync::IntoDynSyncSend; use rustc_error_messages::FluentArgs; use rustc_lint_defs::Applicability; use rustc_span::Span; @@ -45,8 +45,8 @@ pub struct JsonEmitter { #[setters(skip)] dst: IntoDynSyncSend<Box<dyn Write + Send>>, #[setters(skip)] - sm: Option<Lrc<SourceMap>>, - fluent_bundle: Option<Lrc<FluentBundle>>, + sm: Option<Arc<SourceMap>>, + fluent_bundle: Option<Arc<FluentBundle>>, #[setters(skip)] fallback_bundle: LazyFallbackBundle, #[setters(skip)] @@ -65,7 +65,7 @@ pub struct JsonEmitter { impl JsonEmitter { pub fn new( dst: Box<dyn Write + Send>, - sm: Option<Lrc<SourceMap>>, + sm: Option<Arc<SourceMap>>, fallback_bundle: LazyFallbackBundle, pretty: bool, json_rendered: HumanReadableErrorType, @@ -369,7 +369,7 @@ impl Diagnostic { ColorConfig::Always | ColorConfig::Auto => dst = Box::new(termcolor::Ansi::new(dst)), ColorConfig::Never => {} } - HumanEmitter::new(dst, Lrc::clone(&je.fallback_bundle)) + HumanEmitter::new(dst, Arc::clone(&je.fallback_bundle)) .short_message(short) .sm(je.sm.clone()) .fluent_bundle(je.fluent_bundle.clone()) |
