@@ -15,7 +15,6 @@ use rustc::ty::cast::CastTy;
15
15
use rustc:: ty:: query:: Providers ;
16
16
use rustc:: mir:: * ;
17
17
use rustc:: mir:: interpret:: ConstValue ;
18
- use rustc:: mir:: traversal:: ReversePostorder ;
19
18
use rustc:: mir:: visit:: { PlaceContext , Visitor , MutatingUseContext , NonMutatingUseContext } ;
20
19
use rustc:: middle:: lang_items;
21
20
use rustc:: session:: config:: nightly_options;
@@ -31,7 +30,6 @@ use std::usize;
31
30
32
31
use rustc:: hir:: HirId ;
33
32
use crate :: transform:: { MirPass , MirSource } ;
34
- use super :: promote_consts:: { self , Candidate , TempState } ;
35
33
use crate :: transform:: check_consts:: ops:: { self , NonConstOp } ;
36
34
37
35
/// What kind of item we are in.
@@ -477,10 +475,6 @@ struct Checker<'a, 'tcx> {
477
475
478
476
span : Span ,
479
477
def_id : DefId ,
480
- rpo : ReversePostorder < ' a , ' tcx > ,
481
-
482
- temp_promotion_state : IndexVec < Local , TempState > ,
483
- unchecked_promotion_candidates : Vec < Candidate > ,
484
478
485
479
/// If `true`, do not emit errors to the user, merely collect them in `errors`.
486
480
suppress_errors : bool ,
@@ -509,10 +503,6 @@ impl Deref for Checker<'a, 'tcx> {
509
503
impl < ' a , ' tcx > Checker < ' a , ' tcx > {
510
504
fn new ( tcx : TyCtxt < ' tcx > , def_id : DefId , body : & ' a Body < ' tcx > , mode : Mode ) -> Self {
511
505
assert ! ( def_id. is_local( ) ) ;
512
- let mut rpo = traversal:: reverse_postorder ( body) ;
513
- let ( temps, unchecked_promotion_candidates) =
514
- promote_consts:: collect_temps_and_candidates ( tcx, body, & mut rpo) ;
515
- rpo. reset ( ) ;
516
506
517
507
let param_env = tcx. param_env ( def_id) ;
518
508
@@ -539,9 +529,6 @@ impl<'a, 'tcx> Checker<'a, 'tcx> {
539
529
cx,
540
530
span : body. span ,
541
531
def_id,
542
- rpo,
543
- temp_promotion_state : temps,
544
- unchecked_promotion_candidates,
545
532
errors : vec ! [ ] ,
546
533
suppress_errors : false ,
547
534
}
@@ -662,14 +649,6 @@ impl<'a, 'tcx> Checker<'a, 'tcx> {
662
649
let kind = self . body . local_kind ( index) ;
663
650
debug ! ( "store to {:?} {:?}" , kind, index) ;
664
651
665
- // Only handle promotable temps in non-const functions.
666
- if self . mode == Mode :: NonConstFn {
667
- if kind != LocalKind :: Temp ||
668
- !self . temp_promotion_state [ index] . is_promotable ( ) {
669
- return ;
670
- }
671
- }
672
-
673
652
// this is overly restrictive, because even full assignments do not clear the qualif
674
653
// While we could special case full assignments, this would be inconsistent with
675
654
// aggregates where we overwrite all fields via assignments, which would not get
0 commit comments