Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/method_resolution.rs')
-rw-r--r--crates/hir-ty/src/method_resolution.rs38
1 files changed, 19 insertions, 19 deletions
diff --git a/crates/hir-ty/src/method_resolution.rs b/crates/hir-ty/src/method_resolution.rs
index a6150a9bc1..b22781e947 100644
--- a/crates/hir-ty/src/method_resolution.rs
+++ b/crates/hir-ty/src/method_resolution.rs
@@ -581,15 +581,15 @@ impl ReceiverAdjustments {
}
if self.unsize_array {
ty = 'it: {
- if let TyKind::Ref(m, l, inner) = ty.kind(Interner) {
- if let TyKind::Array(inner, _) = inner.kind(Interner) {
- break 'it TyKind::Ref(
- *m,
- l.clone(),
- TyKind::Slice(inner.clone()).intern(Interner),
- )
- .intern(Interner);
- }
+ if let TyKind::Ref(m, l, inner) = ty.kind(Interner)
+ && let TyKind::Array(inner, _) = inner.kind(Interner)
+ {
+ break 'it TyKind::Ref(
+ *m,
+ l.clone(),
+ TyKind::Slice(inner.clone()).intern(Interner),
+ )
+ .intern(Interner);
}
// FIXME: report diagnostic if array unsizing happens without indirection.
ty
@@ -1549,11 +1549,11 @@ fn is_valid_impl_method_candidate(
check_that!(receiver_ty.is_none());
check_that!(name.is_none_or(|n| n == item_name));
- if let Some(from_module) = visible_from_module {
- if !db.assoc_visibility(c.into()).is_visible_from(db, from_module) {
- cov_mark::hit!(const_candidate_not_visible);
- return IsValidCandidate::NotVisible;
- }
+ if let Some(from_module) = visible_from_module
+ && !db.assoc_visibility(c.into()).is_visible_from(db, from_module)
+ {
+ cov_mark::hit!(const_candidate_not_visible);
+ return IsValidCandidate::NotVisible;
}
let self_ty_matches = table.run_in_snapshot(|table| {
let expected_self_ty =
@@ -1638,11 +1638,11 @@ fn is_valid_impl_fn_candidate(
let db = table.db;
let data = db.function_signature(fn_id);
- if let Some(from_module) = visible_from_module {
- if !db.assoc_visibility(fn_id.into()).is_visible_from(db, from_module) {
- cov_mark::hit!(autoderef_candidate_not_visible);
- return IsValidCandidate::NotVisible;
- }
+ if let Some(from_module) = visible_from_module
+ && !db.assoc_visibility(fn_id.into()).is_visible_from(db, from_module)
+ {
+ cov_mark::hit!(autoderef_candidate_not_visible);
+ return IsValidCandidate::NotVisible;
}
table.run_in_snapshot(|table| {
let _p = tracing::info_span!("subst_for_def").entered();