Skip to content

Can still publicly re-export traits that inherit from private supertraits #17847

Closed
@tomjakubowski

Description

@tomjakubowski
Contributor

Example:

#![crate_type="lib"]
pub use a::Child;

mod a {
    pub trait Parent {}
    pub trait Child: Parent {}
}

Looks like this wasn't covered by #17401, but this seems wrong as part of RFC 48.

Activity

alexcrichton

alexcrichton commented on Oct 7, 2014

@alexcrichton
Member

This is actually working as-expected today, the amendment to the RFC states that an item is public if it's marked pub, end of story. That means that the Parent trait is indeed "public" in that sense, and this code should be accepted.

Can you clarify which part of RFC 48 you think forbids this? The amendment may not have updated all the examples! The section you highlighted, however, doesn't seem to forbid this code.

tomjakubowski

tomjakubowski commented on Oct 7, 2014

@tomjakubowski
ContributorAuthor

Ahhhh. Mea culpa: I didn't carefully read what I linked to and was relying on my (now out of date!) memory of the RFC. Thanks for the link to the amendment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @alexcrichton@kmcallister@tomjakubowski

        Issue actions

          Can still publicly re-export traits that inherit from private supertraits · Issue #17847 · rust-lang/rust