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