Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge ObjectSum and PolyTraitRef in AST/HIR + some other refactoring #39110

Merged
merged 5 commits into from
Jan 17, 2017

Conversation

petrochenkov
Copy link
Contributor

ObjectSum and PolyTraitRef are the same thing (list of bounds), they exist separately only due to parser quirks. The second commit merges them.

The first commit replaces Path with Ty in (not yet supported) equality predicates. They are parsed as types anyway and arbitrary types can always be disguised as paths using aliases, so this doesn't add any new functionality.

The third commit uses Vec instead of P<[T]> in AST. AST is not immutable like HIR and Vecs are more convenient for it, unnecessary conversions are also avoided.

The last commit renames parse_ty_sum (which is used for parsing types in general) into parse_ty, and renames parse_ty (which is used restricted contexts where + is not permitted due to operator priorities or other reasons) into parse_ty_no_plus.

This is the first part of #39085 (comment) and #39080 focused on data changes and mechanical renaming, I'll submit a PR with parser changes a bit later.

r? @eddyb

@eddyb
Copy link
Member

eddyb commented Jan 16, 2017

This is getting awkward, I was trying to do this just today. Hopefully they're the same idea.

@eddyb
Copy link
Member

eddyb commented Jan 16, 2017

I prefer TyPolyTraitRef to TyObjectSum - maybe TyTraitObject would be a good name?

@eddyb
Copy link
Member

eddyb commented Jan 16, 2017

Ah, you changed the parser, more elegant than my lowering hack, heh. I'm not super sure about the changes to Vec and the name but everything else seems good to me.

@petrochenkov
Copy link
Contributor Author

I prefer TyPolyTraitRef to TyObjectSum - maybe TyTraitObject would be a good name?

I actually thought about renaming it to something, but decided to avoid extra churn.
TyTraitObject/TyImplTrait looks good, another variant is TyTraitObjectSum/TyImplTraitSum.

@petrochenkov
Copy link
Contributor Author

Renamed ObjectSum -> TraitObject

@eddyb
Copy link
Member

eddyb commented Jan 17, 2017

@bors r+

@bors
Copy link
Contributor

bors commented Jan 17, 2017

📌 Commit 66ef5f2 has been approved by eddyb

@bors
Copy link
Contributor

bors commented Jan 17, 2017

⌛ Testing commit 66ef5f2 with merge a167c04...

bors added a commit that referenced this pull request Jan 17, 2017
Merge ObjectSum and PolyTraitRef in AST/HIR + some other refactoring

`ObjectSum` and `PolyTraitRef` are the same thing (list of bounds), they exist separately only due to parser quirks. The second commit merges them.

The first commit replaces `Path` with `Ty` in (not yet supported) equality predicates. They are parsed as types anyway and arbitrary types can always be disguised as paths using aliases, so this doesn't add any new functionality.

The third commit uses `Vec` instead of `P<[T]>` in AST. AST is not immutable like HIR and `Vec`s are more convenient for it, unnecessary conversions are also avoided.

The last commit renames `parse_ty_sum` (which is used for parsing types in general) into `parse_ty`, and renames `parse_ty` (which is used restricted contexts where `+` is not permitted due to operator priorities or other reasons) into `parse_ty_no_plus`.

This is the first part of #39085 (comment) and #39080 focused on data changes and mechanical renaming, I'll submit a PR with parser changes a bit later.

r? @eddyb
@bors
Copy link
Contributor

bors commented Jan 17, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: eddyb
Pushing a167c04 to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants