Skip to content

Commit

Permalink
tree-wide: parallel: Fully removed all Lrc, replaced with Arc
Browse files Browse the repository at this point in the history
  • Loading branch information
safinaskar committed Feb 3, 2025
1 parent 43dd8e2 commit 9f683c9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/rustc-driver-example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ extern crate rustc_span;

use std::io;
use std::path::Path;
use std::sync::Arc;

use rustc_ast_pretty::pprust::item_to_string;
use rustc_data_structures::sync::Lrc;
use rustc_driver::{Compilation, run_compiler};
use rustc_interface::interface::{Compiler, Config};
use rustc_middle::ty::TyCtxt;
Expand All @@ -43,7 +43,7 @@ fn main() {
}
}

fn read_binary_file(&self, _path: &Path) -> io::Result<Lrc<[u8]>> {
fn read_binary_file(&self, _path: &Path) -> io::Result<Arc<[u8]>> {
Err(io::Error::other("oops"))
}
}
Expand Down
4 changes: 2 additions & 2 deletions examples/rustc-driver-interacting-with-the-ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ extern crate rustc_span;

use std::io;
use std::path::Path;
use std::sync::Arc;

use rustc_ast_pretty::pprust::item_to_string;
use rustc_data_structures::sync::Lrc;
use rustc_driver::{Compilation, run_compiler};
use rustc_interface::interface::{Compiler, Config};
use rustc_middle::ty::TyCtxt;
Expand All @@ -43,7 +43,7 @@ fn main() {
}
}

fn read_binary_file(&self, _path: &Path) -> io::Result<Lrc<[u8]>> {
fn read_binary_file(&self, _path: &Path) -> io::Result<Arc<[u8]>> {
Err(io::Error::other("oops"))
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/diagnostics/lintstore.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Lints are registered via the [`LintStore::register_lint`] function. This should
happen just once for any lint, or an ICE will occur.

Once the registration is complete, we "freeze" the lint store by placing it in
an `Lrc`.
an `Arc`.

Lint passes are registered separately into one of the categories
(pre-expansion, early, late, late module). Passes are registered as a closure
Expand Down
1 change: 0 additions & 1 deletion src/parallel-rustc.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ are implemented differently depending on whether `parallel-compiler` is true.

| data structure | parallel | non-parallel |
| -------------------------------- | --------------------------------------------------- | ------------ |
| Lrc | std::sync::Arc | std::rc::Rc |
| Weak | std::sync::Weak | std::rc::Weak |
| Atomic{Bool}/{Usize}/{U32}/{U64} | std::sync::atomic::Atomic{Bool}/{Usize}/{U32}/{U64} | (std::cell::Cell<bool/usize/u32/u64>) |
| OnceCell | std::sync::OnceLock | std::cell::OnceCell |
Expand Down

0 comments on commit 9f683c9

Please sign in to comment.