-
Notifications
You must be signed in to change notification settings - Fork 183
Further reduce interned type boilerplate #554
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
Further reduce interned type boilerplate #554
Conversation
To avoid collision with `From::from`, which forces us to use UFCS
86739e5
to
9362e9f
Compare
This is more of what I was expecting. But if we do this, it's easy enough to just generate the I guess this is a fundamental tradeoff: would we rather have more "code" or use traits to share "code". The trait route would result in less code generation, but requires we bring the trait into scope. As a side point, I don't really like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM. But I would probably like a review from @nathanwhit and/or @nikomatsakis, since they seemed like they liked the trait approach. But your discretion @detrumi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with this change 👍 . The main downside is that macros arguably make the code more opaque, but this is a pretty simple macro and definitely does have some ergonomic wins.
Builds on top of #550, using a macro to generate the sequence structs,
interned
methods andSequence
impls.