@@ -12,23 +12,23 @@ use rspirv::spirv::{
12
12
AddressingModel , Capability , MemoryModel , Op , SourceLanguage , StorageClass , Word ,
13
13
} ;
14
14
use rspirv:: { binary:: Assemble , binary:: Disassemble } ;
15
+ use rustc_abi:: Size ;
15
16
use rustc_arena:: DroplessArena ;
16
17
use rustc_codegen_ssa:: traits:: ConstCodegenMethods as _;
17
18
use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
18
- use rustc_data_structures:: sync:: Lrc ;
19
19
use rustc_middle:: bug;
20
20
use rustc_middle:: mir:: interpret:: ConstAllocation ;
21
21
use rustc_middle:: ty:: TyCtxt ;
22
22
use rustc_span:: source_map:: SourceMap ;
23
23
use rustc_span:: symbol:: Symbol ;
24
24
use rustc_span:: { DUMMY_SP , FileName , FileNameDisplayPreference , SourceFile , Span } ;
25
- use rustc_target:: abi:: Size ;
26
25
use std:: assert_matches:: assert_matches;
27
26
use std:: cell:: { RefCell , RefMut } ;
28
27
use std:: hash:: { Hash , Hasher } ;
29
28
use std:: iter;
30
29
use std:: ops:: Range ;
31
30
use std:: str;
31
+ use std:: sync:: Arc ;
32
32
use std:: { fs:: File , io:: Write , path:: Path } ;
33
33
34
34
#[ derive( Copy , Clone , Debug , Ord , PartialOrd , Eq , PartialEq , Hash ) ]
@@ -346,16 +346,16 @@ struct WithConstLegality<V> {
346
346
/// equivalent to a whole `rustc` `SourceFile`, but has O(1) `Eq` and `Hash`
347
347
/// implementations (i.e. not involving the path or the contents of the file).
348
348
///
349
- /// This is possible because we can compare `Lrc <SourceFile>`s by equality, as
349
+ /// This is possible because we can compare `Arc <SourceFile>`s by equality, as
350
350
/// `rustc`'s `SourceMap` already ensures that only one `SourceFile` will be
351
351
/// allocated for some given file. For hashing, we could hash the address, or
352
352
///
353
- struct DebugFileKey ( Lrc < SourceFile > ) ;
353
+ struct DebugFileKey ( Arc < SourceFile > ) ;
354
354
355
355
impl PartialEq for DebugFileKey {
356
356
fn eq ( & self , other : & Self ) -> bool {
357
357
let ( Self ( self_sf) , Self ( other_sf) ) = ( self , other) ;
358
- Lrc :: ptr_eq ( self_sf, other_sf)
358
+ Arc :: ptr_eq ( self_sf, other_sf)
359
359
}
360
360
}
361
361
impl Eq for DebugFileKey { }
@@ -829,7 +829,7 @@ impl<'tcx> BuilderSpirv<'tcx> {
829
829
( self . def_debug_file ( lo_loc. file ) , lo_line_col..hi_line_col)
830
830
}
831
831
832
- fn def_debug_file ( & self , sf : Lrc < SourceFile > ) -> DebugFileSpirv < ' tcx > {
832
+ fn def_debug_file ( & self , sf : Arc < SourceFile > ) -> DebugFileSpirv < ' tcx > {
833
833
* self
834
834
. debug_file_cache
835
835
. borrow_mut ( )
@@ -839,7 +839,7 @@ impl<'tcx> BuilderSpirv<'tcx> {
839
839
840
840
// FIXME(eddyb) it would be nicer if we could just rely on
841
841
// `RealFileName::to_string_lossy` returning `Cow<'_, str>`,
842
- // but sadly that `'_` is the lifetime of the temporary `Lrc `,
842
+ // but sadly that `'_` is the lifetime of the temporary `Arc `,
843
843
// not `'tcx`, so we have to arena-allocate to get `&'tcx str`.
844
844
let file_name = match & sf. name {
845
845
FileName :: Real ( name) => {
0 commit comments