From 42abfa0f885834c3c2bf61a4d0fafaa3f570debd Mon Sep 17 00:00:00 2001 From: cynecx Date: Sat, 20 Mar 2021 20:35:57 +0100 Subject: hir_ty: add coverage testing for autoderef_visibility_method test --- crates/hir_ty/src/method_resolution.rs | 1 + crates/hir_ty/src/tests/method_resolution.rs | 1 + 2 files changed, 2 insertions(+) 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( } if let Some(from_module) = visible_from_module { if !db.fn_visibility(m).is_visible_from(db.upcast(), from_module) { + cov_mark::hit!(autoderef_candidate_not_visible); return false; } } 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 { #[test] fn autoderef_visibility_method() { + cov_mark::check!(autoderef_candidate_not_visible); check_infer( r#" #[lang = "deref"] -- cgit v1.2.3