Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/drop.rs')
-rw-r--r--crates/hir-ty/src/drop.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/crates/hir-ty/src/drop.rs b/crates/hir-ty/src/drop.rs
index 61e6720a29..e1fbc85960 100644
--- a/crates/hir-ty/src/drop.rs
+++ b/crates/hir-ty/src/drop.rs
@@ -6,7 +6,6 @@ use hir_def::{
};
use rustc_hash::FxHashSet;
use rustc_type_ir::inherent::{AdtDef, GenericArgs as _, IntoKind};
-use stdx::never;
use crate::{
consteval,
@@ -100,8 +99,8 @@ fn has_drop_glue_impl<'db>(
AdtId::EnumId(id) => id
.enum_variants(db)
.variants
- .iter()
- .map(|&(variant, _, _)| {
+ .values()
+ .map(|&(variant, _)| {
db.field_types(variant.into())
.iter()
.map(|(_, field_ty)| {
@@ -177,9 +176,7 @@ fn has_drop_glue_impl<'db>(
}
}
TyKind::Infer(..) => unreachable!("inference vars shouldn't exist out of inference"),
- TyKind::Pat(..) | TyKind::UnsafeBinder(..) => {
- never!("we do not handle pattern and unsafe binder types");
- DropGlue::None
- }
+ TyKind::Pat(ty, _) => has_drop_glue_impl(infcx, ty, env, visited),
+ TyKind::UnsafeBinder(ty) => has_drop_glue_impl(infcx, ty.skip_binder(), env, visited),
}
}