-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Allow #[rustc_builtin_macro = "name"] #80850
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This makes it possible to have both std::panic and core::panic as a builtin macro, by using different builtin macro names for each. Also removes SyntaxExtension::is_derive_copy, as the macro name (e.g. sym::Copy) is now tracked and provides that information directly.
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Jan 9, 2021
This was referenced Jan 9, 2021
petrochenkov
reviewed
Jan 9, 2021
r=me with the comment addressed. |
petrochenkov
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
Jan 9, 2021
This used to be necessary for `is_builtin` in the past, but is no longer required. Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
m-ou-se
force-pushed
the
rustc-builtin-macro-name
branch
from
January 9, 2021 19:27
c53548b
to
b293bba
Compare
Thanks for the quick review! @bors r=petrochenkov |
📌 Commit b293bba has been approved by |
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-author
Status: This is awaiting some action (such as code changes or more information) from the author.
labels
Jan 9, 2021
JohnTitor
added a commit
to JohnTitor/rust
that referenced
this pull request
Jan 10, 2021
…=petrochenkov Allow #[rustc_builtin_macro = "name"] This adds the option of specifying the name of a builtin macro in the `#[rustc_builtin_macro]` attribute: `#[rustc_builtin_macro = "name"]`. This makes it possible to have both `std::panic!` and `core::panic!` as a builtin macro, by using different builtin macro names for each. This is needed to implement the edition-specific behaviour of the panic macros of RFC 3007. Also removes `SyntaxExtension::is_derive_copy`, as the macro name (e.g. `sym::Copy`) is now tracked and provides that information directly. r? `@petrochenkov`
This was referenced Jan 10, 2021
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 10, 2021
Rollup of 9 pull requests Successful merges: - rust-lang#79502 (Implement From<char> for u64 and u128.) - rust-lang#79968 (Improve core::ptr::drop_in_place debuginfo) - rust-lang#80774 (Fix safety comment) - rust-lang#80801 (Use correct span for structured suggestion) - rust-lang#80803 (Remove useless `fill_in` function) - rust-lang#80820 (Support `download-ci-llvm` on NixOS) - rust-lang#80825 (Remove under-used ImplPolarity enum) - rust-lang#80850 (Allow #[rustc_builtin_macro = "name"]) - rust-lang#80857 (Add comment to `Vec::truncate` explaining `>` vs `>=`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
JohnTitor
added a commit
to JohnTitor/rust
that referenced
this pull request
Jan 11, 2021
resolve: Simplify built-in macro table We don't use full `SyntaxExtension`s from the table, only `SyntaxExtensionKind`s, and `Ident` in `register_builtin_macro` always had dummy span. This PR removes unnecessary data from the table and related function signatures. Noticed when reviewing rust-lang#80850.
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.
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.
This adds the option of specifying the name of a builtin macro in the
#[rustc_builtin_macro]
attribute:#[rustc_builtin_macro = "name"]
.This makes it possible to have both
std::panic!
andcore::panic!
as a builtin macro, by using different builtin macro names for each. This is needed to implement the edition-specific behaviour of the panic macros of RFC 3007.Also removes
SyntaxExtension::is_derive_copy
, as the macro name (e.g.sym::Copy
) is now tracked and provides that information directly.r? @petrochenkov