Auto merge of #16749 - Veykril:on-demand-validation-err, r=Veykril

internal: Some method resolution cleanups
This commit is contained in:
bors 2024-03-11 09:18:24 +00:00
commit a5035f4931
10 changed files with 154 additions and 150 deletions

View file

@ -4037,7 +4037,7 @@ impl Type {
let canonical_ty =
Canonical { value: self.ty.clone(), binders: CanonicalVarKinds::empty(Interner) };
method_resolution::implements_trait(&canonical_ty, db, self.env.clone(), trait_)
method_resolution::implements_trait(&canonical_ty, db, &self.env, trait_)
}
/// Checks that particular type `ty` implements `std::ops::FnOnce`.
@ -4052,12 +4052,7 @@ impl Type {
let canonical_ty =
Canonical { value: self.ty.clone(), binders: CanonicalVarKinds::empty(Interner) };
method_resolution::implements_trait_unique(
&canonical_ty,
db,
self.env.clone(),
fnonce_trait,
)
method_resolution::implements_trait_unique(&canonical_ty, db, &self.env, fnonce_trait)
}
// FIXME: Find better API that also handles const generics