Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/infer/coerce.rs')
-rw-r--r--crates/hir-ty/src/infer/coerce.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/crates/hir-ty/src/infer/coerce.rs b/crates/hir-ty/src/infer/coerce.rs
index aeb354368c..3148ef37d8 100644
--- a/crates/hir-ty/src/infer/coerce.rs
+++ b/crates/hir-ty/src/infer/coerce.rs
@@ -38,7 +38,6 @@
use hir_def::{
CallableDefId,
hir::{ExprId, ExprOrPatId},
- lang_item::LangItem,
signatures::FunctionSignature,
};
use intern::sym;
@@ -612,10 +611,8 @@ where
return Err(TypeError::Mismatch);
}
- let traits = (
- LangItem::Unsize.resolve_trait(self.db(), self.env().krate),
- LangItem::CoerceUnsized.resolve_trait(self.db(), self.env().krate),
- );
+ let lang_items = self.interner().lang_items();
+ let traits = (lang_items.Unsize, lang_items.CoerceUnsized);
let (Some(unsize_did), Some(coerce_unsized_did)) = traits else {
debug!("missing Unsize or CoerceUnsized traits");
return Err(TypeError::Mismatch);