Merge ObjectSum and PolyTraitRef in AST/HIR + some other refactoring #39110
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.
ObjectSum
andPolyTraitRef
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
withTy
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 ofP<[T]>
in AST. AST is not immutable like HIR andVec
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) intoparse_ty
, and renamesparse_ty
(which is used restricted contexts where+
is not permitted due to operator priorities or other reasons) intoparse_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