@@ -7,9 +7,9 @@ use rustc_middle::{bug, mir, span_bug};
77use  rustc_session:: config:: OptLevel ; 
88use  tracing:: { debug,  instrument} ; 
99
10+ use  super :: FunctionCx ; 
1011use  super :: operand:: { OperandRef ,  OperandRefBuilder ,  OperandValue } ; 
1112use  super :: place:: { PlaceRef ,  PlaceValue ,  codegen_tag_value} ; 
12- use  super :: { FunctionCx ,  LocalRef } ; 
1313use  crate :: common:: { IntPredicate ,  TypeKind } ; 
1414use  crate :: traits:: * ; 
1515use  crate :: { MemFlags ,  base} ; 
@@ -501,14 +501,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
501501                self . codegen_place_to_pointer ( bx,  place,  mk_ptr) 
502502            } 
503503
504-             mir:: Rvalue :: Len ( place)  => { 
505-                 let  size = self . evaluate_array_len ( bx,  place) ; 
506-                 OperandRef  { 
507-                     val :  OperandValue :: Immediate ( size) , 
508-                     layout :  bx. cx ( ) . layout_of ( bx. tcx ( ) . types . usize ) , 
509-                 } 
510-             } 
511- 
512504            mir:: Rvalue :: BinaryOp ( op_with_overflow,  box ( ref  lhs,  ref  rhs) ) 
513505                if  let  Some ( op)  = op_with_overflow. overflowing_to_wrapping ( )  =>
514506            { 
@@ -740,21 +732,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
740732        } 
741733    } 
742734
743-     fn  evaluate_array_len ( & mut  self ,  bx :  & mut  Bx ,  place :  mir:: Place < ' tcx > )  -> Bx :: Value  { 
744-         // ZST are passed as operands and require special handling 
745-         // because codegen_place() panics if Local is operand. 
746-         if  let  Some ( index)  = place. as_local ( ) 
747-             && let  LocalRef :: Operand ( op)  = self . locals [ index] 
748-             && let  ty:: Array ( _,  n)  = op. layout . ty . kind ( ) 
749-         { 
750-             let  n = n. try_to_target_usize ( bx. tcx ( ) ) . expect ( "expected monomorphic const in codegen" ) ; 
751-             return  bx. cx ( ) . const_usize ( n) ; 
752-         } 
753-         // use common size calculation for non zero-sized types 
754-         let  cg_value = self . codegen_place ( bx,  place. as_ref ( ) ) ; 
755-         cg_value. len ( bx. cx ( ) ) 
756-     } 
757- 
758735    /// Codegen an `Rvalue::RawPtr` or `Rvalue::Ref` 
759736     fn  codegen_place_to_pointer ( 
760737        & mut  self , 
0 commit comments