7
7
use rustc_data_structures:: bit_set:: BitSet ;
8
8
use rustc_data_structures:: indexed_vec:: IndexVec ;
9
9
use rustc_data_structures:: fx:: FxHashSet ;
10
- use rustc_data_structures:: sync:: Lrc ;
11
10
use rustc_target:: spec:: abi:: Abi ;
12
11
use rustc:: hir;
13
12
use rustc:: hir:: def_id:: DefId ;
@@ -831,7 +830,7 @@ impl<'a, 'tcx> Checker<'a, 'tcx> {
831
830
}
832
831
833
832
/// Check a whole const, static initializer or const fn.
834
- fn check_const ( & mut self ) -> ( u8 , Lrc < BitSet < Local > > ) {
833
+ fn check_const ( & mut self ) -> ( u8 , & ' tcx BitSet < Local > ) {
835
834
debug ! ( "const-checking {} {:?}" , self . mode, self . def_id) ;
836
835
837
836
let mir = self . mir ;
@@ -905,8 +904,6 @@ impl<'a, 'tcx> Checker<'a, 'tcx> {
905
904
}
906
905
}
907
906
908
- let promoted_temps = Lrc :: new ( promoted_temps) ;
909
-
910
907
let mut qualifs = self . qualifs_in_local ( RETURN_PLACE ) ;
911
908
912
909
// Account for errors in consts by using the
@@ -915,7 +912,7 @@ impl<'a, 'tcx> Checker<'a, 'tcx> {
915
912
qualifs = self . qualifs_in_any_value_of_ty ( mir. return_ty ( ) ) ;
916
913
}
917
914
918
- ( qualifs. encode_to_bits ( ) , promoted_temps)
915
+ ( qualifs. encode_to_bits ( ) , self . tcx . arena . alloc ( promoted_temps) )
919
916
}
920
917
}
921
918
@@ -1435,7 +1432,7 @@ pub fn provide(providers: &mut Providers<'_>) {
1435
1432
1436
1433
fn mir_const_qualif < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
1437
1434
def_id : DefId )
1438
- -> ( u8 , Lrc < BitSet < Local > > ) {
1435
+ -> ( u8 , & ' tcx BitSet < Local > ) {
1439
1436
// N.B., this `borrow()` is guaranteed to be valid (i.e., the value
1440
1437
// cannot yet be stolen), because `mir_validated()`, which steals
1441
1438
// from `mir_const(), forces this query to execute before
@@ -1444,7 +1441,7 @@ fn mir_const_qualif<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
1444
1441
1445
1442
if mir. return_ty ( ) . references_error ( ) {
1446
1443
tcx. sess . delay_span_bug ( mir. span , "mir_const_qualif: Mir had errors" ) ;
1447
- return ( 1 << IsNotConst :: IDX , Lrc :: new ( BitSet :: new_empty ( 0 ) ) ) ;
1444
+ return ( 1 << IsNotConst :: IDX , tcx . arena . alloc ( BitSet :: new_empty ( 0 ) ) ) ;
1448
1445
}
1449
1446
1450
1447
Checker :: new ( tcx, def_id, mir, Mode :: Const ) . check_const ( )
0 commit comments