@@ -25,7 +25,6 @@ use type_of;
2525use tvec;
2626use value:: Value ;
2727use Disr ;
28- use glue;
2928
3029use super :: MirContext ;
3130use super :: operand:: { OperandRef , OperandValue } ;
@@ -48,7 +47,6 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
4847 // FIXME: consider not copying constants through stack. (fixable by translating
4948 // constants into OperandValue::Ref, why don’t we do that yet if we don’t?)
5049 self . store_operand ( & bcx, dest. llval , tr_operand) ;
51- self . set_operand_dropped ( & bcx, operand) ;
5250 bcx
5351 }
5452
@@ -92,7 +90,6 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
9290 }
9391 }
9492 } ) ;
95- self . set_operand_dropped ( & bcx, source) ;
9693 bcx
9794 }
9895
@@ -107,7 +104,6 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
107104 block
108105 } )
109106 } ) ;
110- self . set_operand_dropped ( & bcx, elem) ;
111107 bcx
112108 }
113109
@@ -128,7 +124,6 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
128124 val, disr, i) ;
129125 self . store_operand ( & bcx, lldest_i, op) ;
130126 }
131- self . set_operand_dropped ( & bcx, operand) ;
132127 }
133128 } ,
134129 _ => {
@@ -167,7 +162,6 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
167162 let dest = bcx. gepi ( dest. llval , & [ 0 , i] ) ;
168163 self . store_operand ( & bcx, dest, op) ;
169164 }
170- self . set_operand_dropped ( & bcx, operand) ;
171165 }
172166 }
173167 }
@@ -209,9 +203,6 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
209203 asm:: trans_inline_asm ( bcx, asm, outputs, input_vals) ;
210204 } ) ;
211205
212- for input in inputs {
213- self . set_operand_dropped ( & bcx, input) ;
214- }
215206 bcx
216207 }
217208
@@ -269,7 +260,6 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
269260 // &'a fmt::Debug+Send => &'a fmt::Debug,
270261 // So we need to pointercast the base to ensure
271262 // the types match up.
272- self . set_operand_dropped ( & bcx, source) ;
273263 let llcast_ty = type_of:: fat_ptr_base_ty ( bcx. ccx ( ) , cast_ty) ;
274264 let lldata = bcx. pointercast ( lldata, llcast_ty) ;
275265 OperandValue :: FatPtr ( lldata, llextra)
@@ -280,7 +270,6 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
280270 base:: unsize_thin_ptr ( bcx, lldata,
281271 operand. ty , cast_ty)
282272 } ) ;
283- self . set_operand_dropped ( & bcx, source) ;
284273 OperandValue :: FatPtr ( lldata, llextra)
285274 }
286275 OperandValue :: Ref ( _) => {
@@ -569,30 +558,23 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
569558 }
570559}
571560
572- pub fn rvalue_creates_operand < ' bcx , ' tcx > ( mir : & mir:: Mir < ' tcx > ,
573- bcx : & BlockAndBuilder < ' bcx , ' tcx > ,
561+ pub fn rvalue_creates_operand < ' bcx , ' tcx > ( _mir : & mir:: Mir < ' tcx > ,
562+ _bcx : & BlockAndBuilder < ' bcx , ' tcx > ,
574563 rvalue : & mir:: Rvalue < ' tcx > ) -> bool {
575564 match * rvalue {
576565 mir:: Rvalue :: Ref ( ..) |
577566 mir:: Rvalue :: Len ( ..) |
578567 mir:: Rvalue :: Cast ( ..) | // (*)
579568 mir:: Rvalue :: BinaryOp ( ..) |
580569 mir:: Rvalue :: UnaryOp ( ..) |
581- mir:: Rvalue :: Box ( ..) =>
570+ mir:: Rvalue :: Box ( ..) |
571+ mir:: Rvalue :: Use ( ..) =>
582572 true ,
583573 mir:: Rvalue :: Repeat ( ..) |
584574 mir:: Rvalue :: Aggregate ( ..) |
585575 mir:: Rvalue :: Slice { .. } |
586576 mir:: Rvalue :: InlineAsm { .. } =>
587577 false ,
588- mir:: Rvalue :: Use ( ref operand) => {
589- let ty = mir. operand_ty ( bcx. tcx ( ) , operand) ;
590- let ty = bcx. monomorphize ( & ty) ;
591- // Types that don't need dropping can just be an operand,
592- // this allows temporary lvalues, used as rvalues, to
593- // avoid a stack slot when it's unnecessary
594- !glue:: type_needs_drop ( bcx. tcx ( ) , ty)
595- }
596578 }
597579
598580 // (*) this is only true if the type is suitable
0 commit comments