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 !db.fn_visibility(m).is_visible_from(db.upcast(), from_module) {
cov_mark::hit!(autoderef_candidate_not_visible);
return false;
}
}

View File

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