Skip to content

Type alias can be used to bypass privacy check #28450

Closed
@seanmonstar

Description

@seanmonstar
struct Priv;

pub use self::private::public;

mod private {
    pub type Priv = super::Priv;

    pub fn public(_x: Priv) {
    }
}

The function public is exported, accepting the type Priv, even though Priv is not exported.

Metadata

Metadata

Assignees

Labels

P-highHigh priorityT-langRelevant to the language team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions