@@ -212,11 +212,11 @@ impl<'c, 'b, 'a: 'b+'c, 'gcx, 'tcx: 'a> DataflowResultsConsumer<'b, 'gcx>
212
212
// ignored by borrowck
213
213
}
214
214
215
- StatementKind :: StorageDead ( ref lvalue ) => {
215
+ StatementKind :: StorageDead ( local ) => {
216
216
// causes non-drop values to be dropped.
217
217
self . consume_lvalue ( ContextKind :: StorageDead . new ( location) ,
218
218
ConsumeKind :: Consume ,
219
- ( lvalue , span) ,
219
+ ( & Lvalue :: Local ( local ) , span) ,
220
220
flow_state)
221
221
}
222
222
}
@@ -710,7 +710,7 @@ mod restrictions {
710
710
711
711
use rustc:: hir;
712
712
use rustc:: ty:: { self , TyCtxt } ;
713
- use rustc:: mir:: { Lvalue , Mir , Operand , ProjectionElem } ;
713
+ use rustc:: mir:: { Lvalue , Mir , ProjectionElem } ;
714
714
715
715
pub ( super ) struct Restrictions < ' c , ' tcx : ' c > {
716
716
mir : & ' c Mir < ' tcx > ,
@@ -809,12 +809,7 @@ mod restrictions {
809
809
ProjectionElem :: Downcast ( ..) |
810
810
ProjectionElem :: Subslice { .. } |
811
811
ProjectionElem :: ConstantIndex { .. } |
812
- ProjectionElem :: Index ( Operand :: Constant ( ..) ) => {
813
- cursor = & proj. base ;
814
- continue ' cursor;
815
- }
816
- ProjectionElem :: Index ( Operand :: Consume ( ref index) ) => {
817
- self . lvalue_stack . push ( index) ; // FIXME: did old borrowck do this?
812
+ ProjectionElem :: Index ( _) => {
818
813
cursor = & proj. base ;
819
814
continue ' cursor;
820
815
}
@@ -1004,7 +999,7 @@ impl<'c, 'b, 'a: 'b+'c, 'gcx, 'tcx: 'a> MirBorrowckCtxt<'c, 'b, 'a, 'gcx, 'tcx>
1004
999
( "" , format ! ( "" ) , None ) , // (dont emit downcast info)
1005
1000
ProjectionElem :: Field ( field, _ty) =>
1006
1001
( "" , format ! ( ".{}" , field. index( ) ) , None ) ,
1007
- ProjectionElem :: Index ( ref index) =>
1002
+ ProjectionElem :: Index ( index) =>
1008
1003
( "" , format ! ( "" ) , Some ( index) ) ,
1009
1004
ProjectionElem :: ConstantIndex { offset, min_length, from_end : true } =>
1010
1005
( "" , format ! ( "[{} of {}]" , offset, min_length) , None ) ,
@@ -1021,23 +1016,11 @@ impl<'c, 'b, 'a: 'b+'c, 'gcx, 'tcx: 'a> MirBorrowckCtxt<'c, 'b, 'a, 'gcx, 'tcx>
1021
1016
self . append_lvalue_to_string ( & proj. base , buf) ;
1022
1017
if let Some ( index) = index_operand {
1023
1018
buf. push_str ( "[" ) ;
1024
- self . append_operand_to_string ( index, buf) ;
1019
+ self . append_lvalue_to_string ( & Lvalue :: Local ( index) , buf) ;
1025
1020
buf. push_str ( "]" ) ;
1026
1021
} else {
1027
1022
buf. push_str ( & suffix) ;
1028
1023
}
1029
-
1030
- }
1031
- }
1032
- }
1033
-
1034
- fn append_operand_to_string ( & self , operand : & Operand , buf : & mut String ) {
1035
- match * operand {
1036
- Operand :: Consume ( ref lvalue) => {
1037
- self . append_lvalue_to_string ( lvalue, buf) ;
1038
- }
1039
- Operand :: Constant ( ref constant) => {
1040
- buf. push_str ( & format ! ( "{:?}" , constant) ) ;
1041
1024
}
1042
1025
}
1043
1026
}
0 commit comments