aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcynecx <[email protected]>2021-03-20 19:35:57 +0000
committercynecx <[email protected]>2021-03-20 19:35:57 +0000
commit42abfa0f885834c3c2bf61a4d0fafaa3f570debd (patch)
tree5c777edf7ce16245d4a14ef86c459af97ce1a118
parent2dc85f739a678682d6b112d2d990802ffa4ffd90 (diff)
hir_ty: add coverage testing for autoderef_visibility_method test
-rw-r--r--crates/hir_ty/src/method_resolution.rs1
-rw-r--r--crates/hir_ty/src/tests/method_resolution.rs1
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]
1229fn autoderef_visibility_method() { 1229fn 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"]