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.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/crates/hir-ty/src/infer/coerce.rs b/crates/hir-ty/src/infer/coerce.rs
index 847dd43a02..39bd90849f 100644
--- a/crates/hir-ty/src/infer/coerce.rs
+++ b/crates/hir-ty/src/infer/coerce.rs
@@ -8,10 +8,7 @@
use std::iter;
use chalk_ir::{BoundVar, Goal, Mutability, TyKind, TyVariableKind, cast::Cast};
-use hir_def::{
- hir::ExprId,
- lang_item::{LangItem, LangItemTarget},
-};
+use hir_def::{hir::ExprId, lang_item::LangItem};
use stdx::always;
use triomphe::Arc;
@@ -701,8 +698,8 @@ impl InferenceTable<'_> {
reborrow.as_ref().map_or_else(|| from_ty.clone(), |(_, adj)| adj.target.clone());
let krate = self.trait_env.krate;
- let coerce_unsized_trait = match self.db.lang_item(krate, LangItem::CoerceUnsized) {
- Some(LangItemTarget::Trait(trait_)) => trait_,
+ let coerce_unsized_trait = match LangItem::CoerceUnsized.resolve_trait(self.db, krate) {
+ Some(trait_) => trait_,
_ => return Err(TypeError),
};