Skip to content

Expand string literals and exprs inside of macros #12658

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 1 commit into from
Mar 3, 2014

Conversation

sfackler
Copy link
Member

@sfackler sfackler commented Mar 2, 2014

A couple of syntax extensions manually expanded expressions, but it
wasn't done universally, most noticably inside of asm!().

There's also a bit of random cleanup.

@@ -471,7 +472,7 @@ pub fn get_exprs_from_tts(cx: &ExtCtxt,
cx.span_err(sp, "expected token: `,`");
return None;
}
es.push(p.parse_expr());
es.push(cx.expand_expr(p.parse_expr()));
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a test for this change?

@alexcrichton
Copy link
Member

r=me with comments

A couple of syntax extensions manually expanded expressions, but it
wasn't done universally, most noticably inside of asm!().

There's also a bit of random cleanup.
bors added a commit that referenced this pull request Mar 2, 2014
A couple of syntax extensions manually expanded expressions, but it
wasn't done universally, most noticably inside of asm!().

There's also a bit of random cleanup.
@huonw
Copy link
Member

huonw commented Mar 2, 2014

Was #9740 (comment) ever adequately addressed??

@sfackler
Copy link
Member Author

sfackler commented Mar 2, 2014

No idea. I don't think this'll create any hygiene issues immediately since cx.expand_expr is busted and only looks at the "special" built-in extensions (bytes!, format!, etc). I'm not familiar enough with the hygiene infrastructure to know how expand_expr will interact with that after it's fixed.

@bors bors closed this Mar 3, 2014
@bors bors merged commit a0e54c7 into rust-lang:master Mar 3, 2014
@sfackler sfackler deleted the asm-expand branch May 15, 2014 05:03
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