mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Remove some unnecessary cloning in method_resolution
This commit is contained in:
parent
593156a357
commit
d21f88883b
8 changed files with 76 additions and 78 deletions
|
@ -4025,7 +4025,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`.
|
||||
|
@ -4040,12 +4040,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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue