Skip to content

Can currently leak private types and values #309

@baszalmstra

Description

@baszalmstra

Reexporting a type or value from one module to another should check the visibility of the original item.

This can happen in a few cases:

//- foo.mun
// Illegal, Bar has a smaller scope that this use statement
pub(super) struct Bar;

// Illegal, Bar has a smaller scope than this function
pub fn baz() -> Bar {
}
//- mod.mun
pub use foo::Bar; // Should be illegal because Bar is only visible to this module

In rust this emits the error: can't leak private type. This is currently not checked in Mun.

Metadata

Metadata

Assignees

No one assigned

    Labels

    exp: lowAchievable with little prior knowledge and guidancegood first issueGood for newcomerspri: lowAn issue with no impact to quality, performance, or functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions