rust/tests/ui/privacy/effective_visibilities_full_priv.rs
Vadim Petrochenkov 95a24c6ed4 privacy: Do not mark items reachable farther than their nominal visibility
This commit reverts a change made in #111425.
It was believed that this change was necessary for implementing type privacy lints, but #111801 showed that it was not necessary.
Quite opposite, the revert fixes some issues.
2023-06-15 21:25:47 +03:00

22 lines
594 B
Rust

#![feature(rustc_attrs)]
#![allow(private_in_public)]
struct SemiPriv;
mod m {
#[rustc_effective_visibility]
struct Priv;
//~^ ERROR not in the table
//~| ERROR not in the table
#[rustc_effective_visibility]
pub fn foo() {} //~ ERROR Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate)
#[rustc_effective_visibility]
impl crate::SemiPriv { //~ ERROR Direct: pub(crate), Reexported: pub(crate), Reachable: pub(crate), ReachableThroughImplTrait: pub(crate)
pub fn f(_: Priv) {}
}
}
fn main() {}