about summary refs log tree commit diff
path: root/compiler/rustc_ty_utils
diff options
context:
space:
mode:
authorlcnr <rust@lcnr.de>2023-07-18 15:50:34 +0200
committerlcnr <rust@lcnr.de>2023-07-18 15:50:34 +0200
commitd1b4b458c0584f80cf8c202110d2e3846b2abe58 (patch)
tree0243b9006ae550423ceb440ffdf019f90bedb305 /compiler/rustc_ty_utils
parent8a0802089cf057826e057476c2ad184091d88e22 (diff)
downloadrust-d1b4b458c0584f80cf8c202110d2e3846b2abe58.tar.gz
rust-d1b4b458c0584f80cf8c202110d2e3846b2abe58.zip
some additional refactor
also, treat placeholders equal to params
Diffstat (limited to 'compiler/rustc_ty_utils')
-rw-r--r--compiler/rustc_ty_utils/src/needs_drop.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_ty_utils/src/needs_drop.rs b/compiler/rustc_ty_utils/src/needs_drop.rs
index cc19b101fe3..e173bba49be 100644
--- a/compiler/rustc_ty_utils/src/needs_drop.rs
+++ b/compiler/rustc_ty_utils/src/needs_drop.rs
@@ -96,7 +96,7 @@ where
                 return Some(Err(AlwaysRequiresDrop));
             }
 
-            let components = match needs_drop_components(ty, &tcx.data_layout) {
+            let components = match needs_drop_components(tcx, ty) {
                 Err(e) => return Some(Err(e)),
                 Ok(components) => components,
             };
@@ -160,7 +160,7 @@ where
                             queue_type(self, required);
                         }
                     }
-                    ty::Array(..) | ty::Alias(..) | ty::Param(_) => {
+                    ty::Alias(..) | ty::Array(..) | ty::Placeholder(_) | ty::Param(_) => {
                         if ty == component {
                             // Return the type to the caller: they may be able
                             // to normalize further than we can.
@@ -173,7 +173,7 @@ where
                         }
                     }
 
-                    ty::Foreign(_) | ty::Dynamic(..) | ty::Placeholder(_) => {
+                    ty::Foreign(_) | ty::Dynamic(..) => {
                         return Some(Err(AlwaysRequiresDrop));
                     }