Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/method_resolution/confirm.rs')
-rw-r--r--crates/hir-ty/src/method_resolution/confirm.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/crates/hir-ty/src/method_resolution/confirm.rs b/crates/hir-ty/src/method_resolution/confirm.rs
index 9017c2f877..570dd63a50 100644
--- a/crates/hir-ty/src/method_resolution/confirm.rs
+++ b/crates/hir-ty/src/method_resolution/confirm.rs
@@ -5,7 +5,6 @@ use hir_def::{
FunctionId, GenericDefId, GenericParamId, ItemContainerId, TraitId,
expr_store::path::{GenericArg as HirGenericArg, GenericArgs as HirGenericArgs},
hir::{ExprId, generics::GenericParamDataRef},
- lang_item::LangItem,
};
use rustc_type_ir::{
TypeFoldable,
@@ -550,9 +549,7 @@ impl<'a, 'b, 'db> ConfirmContext<'a, 'b, 'db> {
&self,
predicates: impl Iterator<Item = Clause<'db>>,
) -> bool {
- let Some(sized_def_id) =
- LangItem::Sized.resolve_trait(self.db(), self.ctx.resolver.krate())
- else {
+ let Some(sized_def_id) = self.ctx.lang_items.Sized else {
return false;
};
@@ -570,9 +567,7 @@ impl<'a, 'b, 'db> ConfirmContext<'a, 'b, 'db> {
fn check_for_illegal_method_calls(&self) {
// Disallow calls to the method `drop` defined in the `Drop` trait.
if let ItemContainerId::TraitId(trait_def_id) = self.candidate.loc(self.db()).container
- && LangItem::Drop
- .resolve_trait(self.db(), self.ctx.resolver.krate())
- .is_some_and(|drop_trait| drop_trait == trait_def_id)
+ && self.ctx.lang_items.Drop.is_some_and(|drop_trait| drop_trait == trait_def_id)
{
// FIXME: Report an error.
}