-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Add impl_tag!
macro to implement Tag
for tagged pointer easily
#110615
Conversation
This comment has been minimized.
This comment has been minimized.
a8dcee7
to
9ba03e4
Compare
This comment has been minimized.
This comment has been minimized.
9ba03e4
to
77c83c0
Compare
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.
Very cool. I didn't spot any issues except two nits, although I may want to take a second look when you've fixed those.
a5ac778
to
1c74c71
Compare
This comment has been minimized.
This comment has been minimized.
1c74c71
to
ad8c7b6
Compare
( | ||
impl Tag for $Self:ty; | ||
$( | ||
$($path:ident)::* $( { $( $fields:tt )* })? <=> $tag:literal, |
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.
Is customization according to $tag
useful?
If not, you can use ${index()}
to generate it automatically, like rustc_metadata::rmeta::table
does.
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 guess the answer is "it could, but probably isn't". I'll work on it next week.
@rustbot ready |
Great! |
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#110556 (Switch to `EarlyBinder` for `explicit_item_bounds`) - rust-lang#110615 (Add `impl_tag!` macro to implement `Tag` for tagged pointer easily) - rust-lang#110649 (Fix no_global_oom_handling build) - rust-lang#110671 (Consider polarity in new solver) - rust-lang#110783 (Fix ICE on --print=... i/o errors) - rust-lang#110796 (Updating Wake example to use new 'pin!' macro) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
r? @Nilstrieb
This should also lifts the need to think about safety from the callers (
impl_tag!
is robust (ish, see the macro issue)) and removes the possibility of making a "weird"Tag
impl.