diff options
Diffstat (limited to 'crates/hir_ty')
-rw-r--r-- | crates/hir_ty/src/method_resolution.rs | 1 | ||||
-rw-r--r-- | crates/hir_ty/src/tests/method_resolution.rs | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/crates/hir_ty/src/method_resolution.rs b/crates/hir_ty/src/method_resolution.rs index 80e7b7b79..f91208068 100644 --- a/crates/hir_ty/src/method_resolution.rs +++ b/crates/hir_ty/src/method_resolution.rs | |||
@@ -687,6 +687,7 @@ fn is_valid_candidate( | |||
687 | } | 687 | } |
688 | if let Some(from_module) = visible_from_module { | 688 | if let Some(from_module) = visible_from_module { |
689 | if !db.fn_visibility(m).is_visible_from(db.upcast(), from_module) { | 689 | if !db.fn_visibility(m).is_visible_from(db.upcast(), from_module) { |
690 | cov_mark::hit!(autoderef_candidate_not_visible); | ||
690 | return false; | 691 | return false; |
691 | } | 692 | } |
692 | } | 693 | } |
diff --git a/crates/hir_ty/src/tests/method_resolution.rs b/crates/hir_ty/src/tests/method_resolution.rs index 6e74763ca..61f18b0d2 100644 --- a/crates/hir_ty/src/tests/method_resolution.rs +++ b/crates/hir_ty/src/tests/method_resolution.rs | |||
@@ -1227,6 +1227,7 @@ mod b { | |||
1227 | 1227 | ||
1228 | #[test] | 1228 | #[test] |
1229 | fn autoderef_visibility_method() { | 1229 | fn autoderef_visibility_method() { |
1230 | cov_mark::check!(autoderef_candidate_not_visible); | ||
1230 | check_infer( | 1231 | check_infer( |
1231 | r#" | 1232 | r#" |
1232 | #[lang = "deref"] | 1233 | #[lang = "deref"] |