[breaking batch] Rename and refactor ast::Pat_ variants#31581
Merged
bors merged 2 commits intorust-lang:masterfrom Feb 14, 2016
Merged
[breaking batch] Rename and refactor ast::Pat_ variants#31581bors merged 2 commits intorust-lang:masterfrom
bors merged 2 commits intorust-lang:masterfrom
Conversation
Member
|
r=me for this, but I'd like someone else to sign off on the naming scheme too. |
982c2e5 to
bf07420
Compare
Collaborator
|
☔ The latest upstream changes (presumably #31524) made this pull request unmergeable. Please resolve the merge conflicts. |
bf07420 to
9348abe
Compare
Contributor
Author
|
Rebased. |
Member
src/libsyntax/ast.rs
Outdated
Member
There was a problem hiding this comment.
I think this should be just Path.
Contributor
Author
Member
There was a problem hiding this comment.
Associated constants and top-level constants are different though.
Member
|
LGTM except for the |
9348abe to
9f414a4
Compare
Contributor
Author
|
Updated. |
Contributor
Author
|
Ping @Manishearth |
Member
Collaborator
|
📌 Commit 9f414a4 has been approved by |
bors
added a commit
that referenced
this pull request
Feb 14, 2016
cc #31487 (comment) plugin-[breaking-change] The first commit renames `ast::Pat_` to `ast::PatKind` and uses its variants in enum qualified form. I've also taken the opportunity and renamed `PatKind::Region` into `PatKind::Ref`. The second commit splits `PatKind::Enum` into `PatKind::TupleStruct` and `PatKind::UnitStruct`. So, pattern kinds now correspond to their struct/variant kinds - `Struct`, `TupleStruct` and `UnitStruct`. @nikomatsakis @nrc @arielb1 Are you okay with this naming scheme? An alternative possible naming scheme is `PatKind::StructVariant`, `PatKind::TupleVariant`, `PatKind::UnitVariant` (it's probably closer to the common use, but I like it less). I intend to apply these changes to HIR later, they should not necessarily go in the same nightly with #31487 r? @Manishearth
Collaborator
|
⌛ Testing commit 9f414a4 with merge 9d98390... |
Collaborator
bors
added a commit
that referenced
this pull request
Feb 17, 2016
And split `PatKind::Enum` into `PatKind::TupleStruct` and `PatKind::Path`. This is the HIR part of #31581. This is also kind of a preparation for rust-lang/rfcs#1492. r? @eddyb
critiqjo
pushed a commit
to critiqjo/rustdoc
that referenced
this pull request
Dec 16, 2016
And split `PatKind::Enum` into `PatKind::TupleStruct` and `PatKind::Path`. This is the HIR part of rust-lang/rust#31581. This is also kind of a preparation for rust-lang/rfcs#1492. r? @eddyb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

cc #31487 (comment)
plugin-[breaking-change]
The first commit renames
ast::Pat_toast::PatKindand uses its variants in enum qualified form. I've also taken the opportunity and renamedPatKind::RegionintoPatKind::Ref.The second commit splits
PatKind::EnumintoPatKind::TupleStructandPatKind::UnitStruct.So, pattern kinds now correspond to their struct/variant kinds -
Struct,TupleStructandUnitStruct.@nikomatsakis @nrc @arielb1 Are you okay with this naming scheme?
An alternative possible naming scheme is
PatKind::StructVariant,PatKind::TupleVariant,PatKind::UnitVariant(it's probably closer to the common use, but I like it less).I intend to apply these changes to HIR later, they should not necessarily go in the same nightly with #31487
r? @Manishearth