Skip to content

A public fn in a private mod with a private type in its signature #25934

Closed
@IvanUkhov

Description

@IvanUkhov

If a crate has a private module and a private type, the module cannot have a public function whose signature refers to the private type. Here is an illustration:

type Baz = isize;

mod foo {
    use Baz;

    pub fn bar(_: Baz) { // error: private type in exported type signature
    }
}

The public function cannot presumably be qualified as a public-facing part of the crate, and it is not presumably a part of the public API of the crate.

Regards,
Ivan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions