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.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/crates/hir-ty/src/drop.rs b/crates/hir-ty/src/drop.rs
index 9823c854d5..70763759ef 100644
--- a/crates/hir-ty/src/drop.rs
+++ b/crates/hir-ty/src/drop.rs
@@ -19,9 +19,7 @@ fn has_destructor(db: &dyn HirDatabase, adt: AdtId) -> bool {
AdtId::StructId(id) => db.lookup_intern_struct(id).container,
AdtId::UnionId(id) => db.lookup_intern_union(id).container,
};
- let Some(drop_trait) =
- db.lang_item(module.krate(), LangItem::Drop).and_then(|it| it.as_trait())
- else {
+ let Some(drop_trait) = LangItem::Drop.resolve_trait(db, module.krate()) else {
return false;
};
let impls = match module.containing_block() {
@@ -181,8 +179,7 @@ fn projection_has_drop_glue(
}
fn is_copy(db: &dyn HirDatabase, ty: Ty, env: Arc<TraitEnvironment>) -> bool {
- let Some(copy_trait) = db.lang_item(env.krate, LangItem::Copy).and_then(|it| it.as_trait())
- else {
+ let Some(copy_trait) = LangItem::Copy.resolve_trait(db, env.krate) else {
return false;
};
let trait_ref = TyBuilder::trait_ref(db, copy_trait).push(ty).build();