@@ -212,11 +212,11 @@ impl<'c, 'b, 'a: 'b+'c, 'gcx, 'tcx: 'a> DataflowResultsConsumer<'b, 'gcx>
212212 // ignored by borrowck
213213 }
214214
215- StatementKind :: StorageDead ( ref lvalue ) => {
215+ StatementKind :: StorageDead ( local ) => {
216216 // causes non-drop values to be dropped.
217217 self . consume_lvalue ( ContextKind :: StorageDead . new ( location) ,
218218 ConsumeKind :: Consume ,
219- ( lvalue , span) ,
219+ ( & Lvalue :: Local ( local ) , span) ,
220220 flow_state)
221221 }
222222 }
@@ -710,7 +710,7 @@ mod restrictions {
710710
711711 use rustc:: hir;
712712 use rustc:: ty:: { self , TyCtxt } ;
713- use rustc:: mir:: { Lvalue , Mir , Operand , ProjectionElem } ;
713+ use rustc:: mir:: { Lvalue , Mir , ProjectionElem } ;
714714
715715 pub ( super ) struct Restrictions < ' c , ' tcx : ' c > {
716716 mir : & ' c Mir < ' tcx > ,
@@ -809,12 +809,7 @@ mod restrictions {
809809 ProjectionElem :: Downcast ( ..) |
810810 ProjectionElem :: Subslice { .. } |
811811 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 ( _) => {
818813 cursor = & proj. base ;
819814 continue ' cursor;
820815 }
@@ -1004,7 +999,7 @@ impl<'c, 'b, 'a: 'b+'c, 'gcx, 'tcx: 'a> MirBorrowckCtxt<'c, 'b, 'a, 'gcx, 'tcx>
1004999 ( "" , format ! ( "" ) , None ) , // (dont emit downcast info)
10051000 ProjectionElem :: Field ( field, _ty) =>
10061001 ( "" , format ! ( ".{}" , field. index( ) ) , None ) ,
1007- ProjectionElem :: Index ( ref index) =>
1002+ ProjectionElem :: Index ( index) =>
10081003 ( "" , format ! ( "" ) , Some ( index) ) ,
10091004 ProjectionElem :: ConstantIndex { offset, min_length, from_end : true } =>
10101005 ( "" , 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>
10211016 self . append_lvalue_to_string ( & proj. base , buf) ;
10221017 if let Some ( index) = index_operand {
10231018 buf. push_str ( "[" ) ;
1024- self . append_operand_to_string ( index, buf) ;
1019+ self . append_lvalue_to_string ( & Lvalue :: Local ( index) , buf) ;
10251020 buf. push_str ( "]" ) ;
10261021 } else {
10271022 buf. push_str ( & suffix) ;
10281023 }
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) ) ;
10411024 }
10421025 }
10431026 }
0 commit comments