@@ -288,8 +288,6 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for ConstPropMachine {
288
288
}
289
289
}
290
290
291
- type Const < ' tcx > = OpTy < ' tcx > ;
292
-
293
291
/// Finds optimization opportunities on the MIR.
294
292
struct ConstPropagator < ' mir , ' tcx > {
295
293
ecx : InterpCx < ' mir , ' tcx , ConstPropMachine > ,
@@ -387,7 +385,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
387
385
}
388
386
}
389
387
390
- fn get_const ( & self , local : Local ) -> Option < Const < ' tcx > > {
388
+ fn get_const ( & self , local : Local ) -> Option < OpTy < ' tcx > > {
391
389
if local == RETURN_PLACE {
392
390
// Try to read the return place as an immediate so that if it is representable as a
393
391
// scalar, we can handle it as such, but otherwise, just return the value as is.
@@ -470,7 +468,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
470
468
& mut self ,
471
469
c : & Constant < ' tcx > ,
472
470
source_info : SourceInfo ,
473
- ) -> Option < Const < ' tcx > > {
471
+ ) -> Option < OpTy < ' tcx > > {
474
472
self . ecx . tcx . span = c. span ;
475
473
476
474
// FIXME we need to revisit this for #67176
@@ -510,12 +508,12 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
510
508
}
511
509
}
512
510
513
- fn eval_place ( & mut self , place : & Place < ' tcx > , source_info : SourceInfo ) -> Option < Const < ' tcx > > {
511
+ fn eval_place ( & mut self , place : & Place < ' tcx > , source_info : SourceInfo ) -> Option < OpTy < ' tcx > > {
514
512
trace ! ( "eval_place(place={:?})" , place) ;
515
513
self . use_ecx ( source_info, |this| this. ecx . eval_place_to_op ( place, None ) )
516
514
}
517
515
518
- fn eval_operand ( & mut self , op : & Operand < ' tcx > , source_info : SourceInfo ) -> Option < Const < ' tcx > > {
516
+ fn eval_operand ( & mut self , op : & Operand < ' tcx > , source_info : SourceInfo ) -> Option < OpTy < ' tcx > > {
519
517
match * op {
520
518
Operand :: Constant ( ref c) => self . eval_constant ( c, source_info) ,
521
519
Operand :: Move ( ref place) | Operand :: Copy ( ref place) => {
@@ -664,7 +662,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
664
662
fn replace_with_const (
665
663
& mut self ,
666
664
rval : & mut Rvalue < ' tcx > ,
667
- value : Const < ' tcx > ,
665
+ value : OpTy < ' tcx > ,
668
666
source_info : SourceInfo ,
669
667
) {
670
668
trace ! ( "attepting to replace {:?} with {:?}" , rval, value) ;
0 commit comments