Skip to content

Private enum variant reexport error emits an error per each variant #46209

Closed

Description

@estebank

When trying to reexport the variants of a private enum, a diagnostic is emitted for each variant pointing always at the same reexport span, making it too verbose:

error: variant `Variant1` is private, and cannot be reexported, consider declaring its enum as `pub`
  --> file.rs:12:9
   |
12 | pub use self::Enum::*;
   |         ^^^^^^^^^^^^^
(...)
error: variant `VariantN` is private, and cannot be reexported, consider declaring its enum as `pub`
  --> file.rs:12:9
   |
12 | pub use self::Enum::*;
   |         ^^^^^^^^^^^^^

Ideally there would be only one diagnostic emitted, with an extra span pointing at the definition of Enum to suggest making it public.

Activity

  1. added
    A-diagnosticsArea: Messages for errors, warnings, and lints
    C-enhancementCategory: An issue proposing an enhancement or a PR with one.
    on Nov 23, 2017
  2. zackmdavis commented on Nov 23, 2017

    @zackmdavis
    Contributor

    I have a vision for this.

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

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.WG-diagnosticsWorking group: Diagnostics

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions