diff options
| author | bors <bors@rust-lang.org> | 2021-09-18 03:30:13 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-09-18 03:30:13 +0000 |
| commit | 6c33a0a2ec8a32016fcb35342ae9d08087e38d5c (patch) | |
| tree | 29210e998d8a3cb0331b40a419e07d23bd880795 /compiler/rustc_span/src/lib.rs | |
| parent | 8e398f5ba77b283b529c0c61cc2313c4f82d61dd (diff) | |
| parent | ccba8cb4bb6ba5c2c136f14952ff6119020cc7f5 (diff) | |
| download | rust-6c33a0a2ec8a32016fcb35342ae9d08087e38d5c.tar.gz rust-6c33a0a2ec8a32016fcb35342ae9d08087e38d5c.zip | |
Auto merge of #88978 - bjorn3:move_symbol_interner_lock, r=Mark-Simulacrum
Move the Lock into symbol::Interner This makes it easier to make the symbol interner (near) lock free in case of concurrent accesses in the future. With https://github.com/rust-lang/rust/pull/87867 landed this shouldn't affect performance anymore.
Diffstat (limited to 'compiler/rustc_span/src/lib.rs')
| -rw-r--r-- | compiler/rustc_span/src/lib.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs index eb496140553..9c5469f635f 100644 --- a/compiler/rustc_span/src/lib.rs +++ b/compiler/rustc_span/src/lib.rs @@ -78,7 +78,7 @@ mod tests; // threads within the compilation session, but is not accessible outside the // session. pub struct SessionGlobals { - symbol_interner: Lock<symbol::Interner>, + symbol_interner: symbol::Interner, span_interner: Lock<span_encoding::SpanInterner>, hygiene_data: Lock<hygiene::HygieneData>, source_map: Lock<Option<Lrc<SourceMap>>>, @@ -87,7 +87,7 @@ pub struct SessionGlobals { impl SessionGlobals { pub fn new(edition: Edition) -> SessionGlobals { SessionGlobals { - symbol_interner: Lock::new(symbol::Interner::fresh()), + symbol_interner: symbol::Interner::fresh(), span_interner: Lock::new(span_encoding::SpanInterner::default()), hygiene_data: Lock::new(hygiene::HygieneData::new(edition)), source_map: Lock::new(None), |
