diff options
| author | Askar Safin <safinaskar@mail.ru> | 2025-02-03 06:44:41 +0300 |
|---|---|---|
| committer | Askar Safin <safinaskar@mail.ru> | 2025-02-03 13:25:57 +0300 |
| commit | 0a21f1d0a2fe9e84727a2de735fdcf55e8820db6 (patch) | |
| tree | 790f1892d90201443d543562fb9d6cdaf0c6b33f /compiler/rustc_session/src/parse.rs | |
| parent | 613bdd49978298648ed05ace086bd1ecad54b44a (diff) | |
| download | rust-0a21f1d0a2fe9e84727a2de735fdcf55e8820db6.tar.gz rust-0a21f1d0a2fe9e84727a2de735fdcf55e8820db6.zip | |
tree-wide: parallel: Fully removed all `Lrc`, replaced with `Arc`
Diffstat (limited to 'compiler/rustc_session/src/parse.rs')
| -rw-r--r-- | compiler/rustc_session/src/parse.rs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/compiler/rustc_session/src/parse.rs b/compiler/rustc_session/src/parse.rs index 81ae06602cd..e0405a71f65 100644 --- a/compiler/rustc_session/src/parse.rs +++ b/compiler/rustc_session/src/parse.rs @@ -2,11 +2,12 @@ //! It also serves as an input to the parser itself. use std::str; +use std::sync::Arc; use rustc_ast::attr::AttrIdGenerator; use rustc_ast::node_id::NodeId; use rustc_data_structures::fx::{FxHashMap, FxIndexMap, FxIndexSet}; -use rustc_data_structures::sync::{AppendOnlyVec, Lock, Lrc}; +use rustc_data_structures::sync::{AppendOnlyVec, Lock}; use rustc_errors::emitter::{HumanEmitter, SilentEmitter, stderr_destination}; use rustc_errors::{ ColorConfig, Diag, DiagCtxt, DiagCtxtHandle, DiagMessage, EmissionGuarantee, MultiSpan, @@ -214,7 +215,7 @@ pub struct ParseSess { /// should be. Useful to avoid bad tokenization when encountering emoji. We group them to /// provide a single error per unique incorrect identifier. pub bad_unicode_identifiers: Lock<FxIndexMap<Symbol, Vec<Span>>>, - source_map: Lrc<SourceMap>, + source_map: Arc<SourceMap>, pub buffered_lints: Lock<Vec<BufferedEarlyLint>>, /// Contains the spans of block expressions that could have been incomplete based on the /// operation token that followed it, but that the parser cannot identify without further @@ -239,16 +240,16 @@ impl ParseSess { /// Used for testing. pub fn new(locale_resources: Vec<&'static str>) -> Self { let fallback_bundle = fallback_fluent_bundle(locale_resources, false); - let sm = Lrc::new(SourceMap::new(FilePathMapping::empty())); + let sm = Arc::new(SourceMap::new(FilePathMapping::empty())); let emitter = Box::new( HumanEmitter::new(stderr_destination(ColorConfig::Auto), fallback_bundle) - .sm(Some(Lrc::clone(&sm))), + .sm(Some(Arc::clone(&sm))), ); let dcx = DiagCtxt::new(emitter); ParseSess::with_dcx(dcx, sm) } - pub fn with_dcx(dcx: DiagCtxt, source_map: Lrc<SourceMap>) -> Self { + pub fn with_dcx(dcx: DiagCtxt, source_map: Arc<SourceMap>) -> Self { Self { dcx, unstable_features: UnstableFeatures::from_environment(None), @@ -276,7 +277,7 @@ impl ParseSess { emit_fatal_diagnostic: bool, ) -> Self { let fallback_bundle = fallback_fluent_bundle(locale_resources, false); - let sm = Lrc::new(SourceMap::new(FilePathMapping::empty())); + let sm = Arc::new(SourceMap::new(FilePathMapping::empty())); let fatal_emitter = Box::new(HumanEmitter::new(stderr_destination(ColorConfig::Auto), fallback_bundle)); let dcx = DiagCtxt::new(Box::new(SilentEmitter { @@ -293,8 +294,8 @@ impl ParseSess { &self.source_map } - pub fn clone_source_map(&self) -> Lrc<SourceMap> { - Lrc::clone(&self.source_map) + pub fn clone_source_map(&self) -> Arc<SourceMap> { + Arc::clone(&self.source_map) } pub fn buffer_lint( |
