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

Add impl_tag! macro to implement Tag for tagged pointer easily #110615

Merged
merged 6 commits into from
Apr 25, 2023

Conversation

WaffleLapkin
Copy link
Member

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.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 20, 2023
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

Copy link
Member

@Noratrieb Noratrieb left a 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.

@rust-log-analyzer

This comment has been minimized.

(
impl Tag for $Self:ty;
$(
$($path:ident)::* $( { $( $fields:tt )* })? <=> $tag:literal,
Copy link
Contributor

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.

Copy link
Member Author

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.

@WaffleLapkin WaffleLapkin added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 21, 2023
@WaffleLapkin
Copy link
Member Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 24, 2023
@cjgillot
Copy link
Contributor

Great!
@bors r+

@bors
Copy link
Contributor

bors commented Apr 25, 2023

📌 Commit bec7ce4 has been approved by cjgillot

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 25, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 25, 2023
…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
@bors bors merged commit 8d00a8d into rust-lang:master Apr 25, 2023
@rustbot rustbot added this to the 1.71.0 milestone Apr 25, 2023
@WaffleLapkin WaffleLapkin deleted the impl_tag branch May 7, 2023 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants