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.
Let's say that we want to create a
Send
variant of a trait but we don't need a non-Send
variant of that trait at all. We could of course just write that trait, but adding theSend
bounds in all the right places could be annoying.In this commit, we allow simply omitting the new variant name from the call to
make
. When called that way, we use the name from the item to emit only one variant with the bounds applied. We don't emit the original item.For completeness and explicit disambiguation, we support prefixing the bounds with a colon (but giving no variant name). Similarly, for completeness, we support giving the same name as the trait item. In both of these cases, we just emit the one variant. Since these are for completeness, we don't advertise these syntaxes in the documentation.
That is, we now support:
make(NAME: BOUNDS)
make(NAME:)
make(:BOUNDS)
make(BOUNDS)
This resolves #18.