Skip to content

Commit

Permalink
Auto merge of #136471 - safinaskar:parallel, r=SparrowLii
Browse files Browse the repository at this point in the history
tree-wide: parallel: Fully removed all `Lrc`, replaced with `Arc`

tree-wide: parallel: Fully removed all `Lrc`, replaced with `Arc`

This is continuation of rust-lang/rust#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" ( rust-lang/rust#113349 )

r? SparrowLii

`@rustbot` label WG-compiler-parallel
  • Loading branch information
bors committed Feb 6, 2025
2 parents 819ab9b + e0d8fb9 commit db4b00f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/debuginfo.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use std::ops::Range;
use std::sync::Arc;

use gccjit::{Location, RValue};
use rustc_abi::Size;
use rustc_codegen_ssa::mir::debuginfo::{DebugScope, FunctionDebugContext, VariableKind};
use rustc_codegen_ssa::traits::{DebugInfoBuilderMethods, DebugInfoCodegenMethods};
use rustc_data_structures::sync::Lrc;
use rustc_index::bit_set::DenseBitSet;
use rustc_index::{Idx, IndexVec};
use rustc_middle::mir::{self, Body, SourceScope};
Expand Down Expand Up @@ -172,7 +172,7 @@ fn make_mir_scope<'gcc, 'tcx>(
// `lookup_char_pos` return the right information instead.
pub struct DebugLoc {
/// Information about the original source file.
pub file: Lrc<SourceFile>,
pub file: Arc<SourceFile>,
/// The (1-based) line number.
pub line: u32,
/// The (1-based) column number.
Expand Down

0 comments on commit db4b00f

Please sign in to comment.