Skip to content

Support the new panic!() macro #8304

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

Merged
merged 3 commits into from
Apr 3, 2021
Merged

Support the new panic!() macro #8304

merged 3 commits into from
Apr 3, 2021

Conversation

jonas-schievink
Copy link
Contributor

Includes a minor fixup to macro 2.0 parsing.

bors r+

@bors
Copy link
Contributor

bors bot commented Apr 3, 2021

@bors bors bot merged commit bf695c4 into rust-lang:master Apr 3, 2021
@jonas-schievink jonas-schievink deleted the panic-macro branch April 3, 2021 01:26
@@ -1402,8 +1402,18 @@ impl ModCollector<'_, '_> {

// Case 1: builtin macros
if attrs.by_key("rustc_builtin_macro").exists() {
// `#[rustc_builtin_macro = "builtin_name"]` overrides the `macro_rules!` name.
let name;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to delete ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it is assigned a tt::Ident below at line 1410. The next let name = then gets a reference to the tt::Ident as value at line 1411.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL ! Neat !

@lnicola
Copy link
Member

lnicola commented Apr 3, 2021

changelog fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants