Optimize pub(crate) visibility resolution

This commit is contained in:
Lukas Wirth 2025-06-14 14:33:52 +02:00
parent 4b38ea5abd
commit e129cdc202
12 changed files with 55 additions and 36 deletions

View file

@ -144,6 +144,7 @@ pub fn print_variant_body_hir(db: &dyn DefDatabase, owner: VariantId, edition: E
w!(p, "{}", interned.display(db, p.edition))
}
crate::item_tree::RawVisibility::Public => w!(p, "pub "),
crate::item_tree::RawVisibility::PubCrate => w!(p, "pub(crate) "),
}
if *is_unsafe {
w!(p, "unsafe ");

View file

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