hir_ty: add coverage testing for autoderef_visibility_method test

This commit is contained in:
cynecx 2021-03-20 20:35:57 +01:00
parent 2dc85f739a
commit 42abfa0f88
2 changed files with 2 additions and 0 deletions

View file

@ -687,6 +687,7 @@ fn is_valid_candidate(
} }
if let Some(from_module) = visible_from_module { if let Some(from_module) = visible_from_module {
if !db.fn_visibility(m).is_visible_from(db.upcast(), from_module) { if !db.fn_visibility(m).is_visible_from(db.upcast(), from_module) {
cov_mark::hit!(autoderef_candidate_not_visible);
return false; return false;
} }
} }

View file

@ -1227,6 +1227,7 @@ mod b {
#[test] #[test]
fn autoderef_visibility_method() { fn autoderef_visibility_method() {
cov_mark::check!(autoderef_candidate_not_visible);
check_infer( check_infer(
r#" r#"
#[lang = "deref"] #[lang = "deref"]