This repository was archived by the owner on May 28, 2025. It is now read-only.
  
  
  
  
    
    
    
      
    
  
  
    
File tree Expand file tree Collapse file tree 2 files changed +0
-44
lines changed 
rustc_const_eval/src/check_consts Expand file tree Collapse file tree 2 files changed +0
-44
lines changed Original file line number Diff line number Diff line change @@ -170,11 +170,6 @@ impl Qualif for NeedsNonConstDrop {
170170
171171    #[ instrument( level = "trace" ,  skip( cx) ,  ret) ]  
172172    fn  in_any_value_of_ty < ' tcx > ( cx :  & ConstCx < ' _ ,  ' tcx > ,  ty :  Ty < ' tcx > )  -> bool  { 
173-         // Avoid selecting for simple cases, such as builtin types. 
174-         if  ty:: util:: is_trivially_const_drop ( ty)  { 
175-             return  false ; 
176-         } 
177- 
178173        // If this doesn't need drop at all, then don't select `~const Destruct`. 
179174        if  !ty. needs_drop ( cx. tcx ,  cx. typing_env )  { 
180175            return  false ; 
Original file line number Diff line number Diff line change @@ -1672,45 +1672,6 @@ pub fn needs_drop_components_with_async<'tcx>(
16721672    } 
16731673} 
16741674
1675- pub  fn  is_trivially_const_drop ( ty :  Ty < ' _ > )  -> bool  { 
1676-     match  * ty. kind ( )  { 
1677-         ty:: Bool 
1678-         | ty:: Char 
1679-         | ty:: Int ( _) 
1680-         | ty:: Uint ( _) 
1681-         | ty:: Float ( _) 
1682-         | ty:: Infer ( ty:: IntVar ( _) ) 
1683-         | ty:: Infer ( ty:: FloatVar ( _) ) 
1684-         | ty:: Str 
1685-         | ty:: RawPtr ( _,  _) 
1686-         | ty:: Ref ( ..) 
1687-         | ty:: FnDef ( ..) 
1688-         | ty:: FnPtr ( ..) 
1689-         | ty:: Never 
1690-         | ty:: Foreign ( _)  => true , 
1691- 
1692-         ty:: Alias ( ..) 
1693-         | ty:: Dynamic ( ..) 
1694-         | ty:: Error ( _) 
1695-         | ty:: Bound ( ..) 
1696-         | ty:: Param ( _) 
1697-         | ty:: Placeholder ( _) 
1698-         | ty:: Infer ( _)  => false , 
1699- 
1700-         // Not trivial because they have components, and instead of looking inside, 
1701-         // we'll just perform trait selection. 
1702-         ty:: Closure ( ..) 
1703-         | ty:: CoroutineClosure ( ..) 
1704-         | ty:: Coroutine ( ..) 
1705-         | ty:: CoroutineWitness ( ..) 
1706-         | ty:: Adt ( ..)  => false , 
1707- 
1708-         ty:: Array ( ty,  _)  | ty:: Slice ( ty)  | ty:: Pat ( ty,  _)  => is_trivially_const_drop ( ty) , 
1709- 
1710-         ty:: Tuple ( tys)  => tys. iter ( ) . all ( |ty| is_trivially_const_drop ( ty) ) , 
1711-     } 
1712- } 
1713- 
17141675/// Does the equivalent of 
17151676/// ```ignore (illustrative) 
17161677/// let v = self.iter().map(|p| p.fold_with(folder)).collect::<SmallVec<[_; 8]>>(); 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments