22//
33// SPDX-License-Identifier: MIT OR Apache-2.0
44
5+ use std:: sync:: Arc ;
6+
57use rustc_data_structures:: fx:: { FxHashMap , FxIndexSet } ;
6- use rustc_data_structures:: sync:: Lrc ;
78use rustc_middle:: mir:: interpret:: { self , AllocDecodingState , AllocId } ;
89use rustc_middle:: ty:: { self , Ty , TyCtxt , TyDecoder , TyEncoder } ;
910use rustc_serialize:: opaque:: { MemDecoder , MAGIC_END_BYTES } ;
@@ -113,7 +114,7 @@ pub struct EncodeContext<'tcx> {
113114 type_shorthands : FxHashMap < Ty < ' tcx > , usize > ,
114115 predicate_shorthands : FxHashMap < ty:: PredicateKind < ' tcx > , usize > ,
115116 interpret_allocs : FxIndexSet < AllocId > ,
116- relative_file : Lrc < SourceFile > ,
117+ relative_file : Arc < SourceFile > ,
117118}
118119
119120impl < ' tcx > EncodeContext < ' tcx > {
@@ -239,7 +240,7 @@ impl<'tcx> SpanEncoder for EncodeContext<'tcx> {
239240 return TAG_PARTIAL_SPAN . encode ( self ) ;
240241 }
241242
242- if Lrc :: ptr_eq ( & pos. sf , & self . relative_file ) {
243+ if Arc :: ptr_eq ( & pos. sf , & self . relative_file ) {
243244 TAG_RELATIVE_SPAN . encode ( self ) ;
244245 ( span. lo - self . relative_file . start_pos ) . encode ( self ) ;
245246 ( span. hi - self . relative_file . start_pos ) . encode ( self ) ;
@@ -274,9 +275,9 @@ pub struct DecodeContext<'a, 'tcx> {
274275 decoder : MemDecoder < ' a > ,
275276 tcx : TyCtxt < ' tcx > ,
276277 type_shorthands : FxHashMap < usize , Ty < ' tcx > > ,
277- alloc_decoding_state : Lrc < AllocDecodingState > ,
278+ alloc_decoding_state : Arc < AllocDecodingState > ,
278279 replacement_span : Span ,
279- relative_file : Lrc < SourceFile > ,
280+ relative_file : Arc < SourceFile > ,
280281}
281282
282283impl < ' a , ' tcx > DecodeContext < ' a , ' tcx > {
@@ -289,7 +290,7 @@ impl<'a, 'tcx> DecodeContext<'a, 'tcx> {
289290 let mut decoder = MemDecoder :: new ( bytes, vec_position) . unwrap ( ) ;
290291 let interpret_alloc_index = Vec :: < u64 > :: decode ( & mut decoder) ;
291292 let alloc_decoding_state =
292- Lrc :: new ( interpret:: AllocDecodingState :: new ( interpret_alloc_index) ) ;
293+ Arc :: new ( interpret:: AllocDecodingState :: new ( interpret_alloc_index) ) ;
293294
294295 Self {
295296 decoder : MemDecoder :: new ( bytes, 0 ) . unwrap ( ) ,
0 commit comments