Skip to content

spanned HIR node enums should be named FooKind rather than being named Foo_ and glob-exported #51968

Closed

Description

@zackmdavis

@petrochenkov writes:

The convention enum Something_ { SomethingVariant } is "deprecated" and exists in HIR only because not all HIR structures were updated to the "modern" form enum SomethingKind { Variant } like it was done in AST.

New structures should not use it, so it'd be better to rename Visibility_ to VisibilityKind.

The referenced changes to AST were mostly in February 2016's #31487 (justification). The following HIR nodes are still using the underscore-suffix convention, and should probably be changed to the Kind style for consistency:

Activity

  1. varkor commented on Jul 1, 2018

    @varkor
    Contributor

    Presumably this applies to Expr_ too?

  2. zackmdavis commented on Jul 1, 2018

    @zackmdavis
    ContributorAuthor

    Ah, yes: I was searching for Spanned, but the same rationale would apply to Expr_, Ty_, and ForeignItem_.

  3. added
    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
    on Jul 2, 2018
  4. oli-obk commented on Jul 2, 2018

    @oli-obk
    Contributor

    Since any of these changes will break clippy I would be delighted if a PR doing them would also update clippy with the relevant changes. Not a blocker though!

  5. added
    C-cleanupCategory: PRs that clean code up or issues documenting cleanup.
    on Jul 4, 2018
  6. added a commit that references this issue on Jul 16, 2018
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

    C-cleanupCategory: PRs that clean code up or issues documenting cleanup.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions