Skip to content

Refine the story of externally referenced private structures. #10573

Closed
@alexcrichton

Description

@alexcrichton

From my understanding, the story of a private structure that is returned from a public api is a little hazy today. For example, what's the reasonable thing to do in these situations:

  1. Can I call a method on a private struct?
  2. Can I access fields of a private struct?
  3. Can I return a private struct?
  4. Can I reference a public type through which I can reach a private struct?
  5. Can I reference a private type which I receive through a public method in a type signature?

Questions 1-4 are answered with 'yes' today, but the answer to question 5 is no. I believe that these should either all be no, or all be yes. In my opinion, it's just too painful for them to all be 'no', and it's unclear to me whether there's benefit to that.

Nominating, we need to decide this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-visibilityArea: Visibility / privacyP-lowLow priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions