Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/dyn_compatibility.rs')
| -rw-r--r-- | crates/hir-ty/src/dyn_compatibility.rs | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/crates/hir-ty/src/dyn_compatibility.rs b/crates/hir-ty/src/dyn_compatibility.rs index ffdc9ca0f8..59cfd3fdc9 100644 --- a/crates/hir-ty/src/dyn_compatibility.rs +++ b/crates/hir-ty/src/dyn_compatibility.rs @@ -328,13 +328,9 @@ where } let sig = db.callable_item_signature(func.into()); - if sig - .skip_binder() - .inputs() - .iter() - .skip(1) - .any(|ty| contains_illegal_self_type_reference(db, trait_, &ty, AllowSelfProjection::Yes)) - { + if sig.skip_binder().inputs().iter().skip(1).any(|ty| { + contains_illegal_self_type_reference(db, trait_, ty.skip_binder(), AllowSelfProjection::Yes) + }) { cb(MethodViolationCode::ReferencesSelfInput)?; } @@ -411,11 +407,11 @@ fn receiver_is_dispatchable<'db>( // `self: Self` can't be dispatched on, but this is already considered dyn-compatible // See rustc's comment on https://github.com/rust-lang/rust/blob/3f121b9461cce02a703a0e7e450568849dfaa074/compiler/rustc_trait_selection/src/traits/object_safety.rs#L433-L437 - if sig.inputs().iter().next().is_some_and(|p| p.skip_binder() == self_param_ty) { + if sig.inputs().iter().next().is_some_and(|p| *p.skip_binder() == self_param_ty) { return true; } - let Some(&receiver_ty) = sig.inputs().skip_binder().as_slice().first() else { + let Some(&receiver_ty) = sig.inputs().skip_binder().first() else { return false; }; |