9501: internal: Add a coverage mark r=jonas-schievink a=jonas-schievink

https://github.com/rust-analyzer/rust-analyzer/pull/9499#discussion_r663966671

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
This commit is contained in:
bors[bot] 2021-07-05 15:06:55 +00:00 committed by GitHub
commit 8b8eac5bf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -348,6 +348,7 @@ fn foo() {
#[test]
fn is_visible_from_same_def_map() {
// Regression test for https://github.com/rust-analyzer/rust-analyzer/issues/9481
cov_mark::check!(is_visible_from_same_block_def_map);
check_at(
r#"
fn outer() {

View File

@ -139,6 +139,7 @@ impl Visibility {
let arc;
let to_module_def_map =
if to_module.krate == def_map.krate() && to_module.block == def_map.block_id() {
cov_mark::hit!(is_visible_from_same_block_def_map);
def_map
} else {
arc = to_module.def_map(db);