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

quasi-quoting a block expression doesn't work #26994

Closed
nrc opened this Issue Jul 12, 2015 · 4 comments

Comments

Projects
None yet
4 participants
@nrc
Copy link
Member

nrc commented Jul 12, 2015

quote_expr!(self.cx, { $result_name = Some($expr); break $loop_label; }) failed with error: expected one of.,;,}, or an operator, found'__hoare_2``(__hoare_2is the expected value of`$loop_label`). This failed in expansion so I couldn't get an expanded AST to find out what was going on.

The work around:

                let stmts = vec![quote_stmt!(self.cx, $result_name = Some($expr);).unwrap(),
                                 quote_stmt!(self.cx, break $loop_label;).unwrap()];
                self.cx.expr_block(self.cx.block(stmts[0].span, stmts, None))

worked fine

@nrc nrc added the A-syntaxext label Jul 12, 2015

@nrc

This comment has been minimized.

Copy link
Member Author

nrc commented Jul 12, 2015

I think this has something to do with the ident loop_label, quasi-quoting is not pasting it into the break label position correctly. I previously had similar problems when I forgot to start the label name with a ', but that is not the problem here.

Note that the 'correct' version above compiles without an error, but generates incorrect code - no label to break to. If I build that part of the AST by hand, then it works fine.

@brson brson added the P-low label Jan 12, 2017

@brson

This comment has been minimized.

Copy link
Contributor

brson commented Jan 12, 2017

@nrc do you still care about this issue. Seems like an internal defect that doesn't much matter.

@nrc

This comment has been minimized.

Copy link
Member Author

nrc commented Jan 12, 2017

It's not entirely internal since syntax extensions can use quasi-quoting. I suppose this will get 'fixed' when we change to token based quasi-quoting, but until then I think this is relevant

@steveklabnik

This comment has been minimized.

Copy link
Member

steveklabnik commented Oct 31, 2018

Triage: being removed in #51285

bors added a commit that referenced this issue Dec 8, 2018

Auto merge of #51285 - Mark-Simulacrum:remove-quote_apis, r=<try>
Remove quote_*! macros

This deletes a considerable amount of test cases, some of which we may want to keep. I'm not entirely certain what the primary intent of many of them was; if we should keep them I can attempt to edit each case to continue compiling without the quote_*! macros involved.

Fixes #46849.
Fixes #12265.
Fixes #12266.
Fixes #26994.

r? @Manishearth

bors added a commit that referenced this issue Dec 8, 2018

Auto merge of #51285 - Mark-Simulacrum:remove-quote_apis, r=<try>
Remove quote_*! macros

This deletes a considerable amount of test cases, some of which we may want to keep. I'm not entirely certain what the primary intent of many of them was; if we should keep them I can attempt to edit each case to continue compiling without the quote_*! macros involved.

Fixes #46849.
Fixes #12265.
Fixes #12266.
Fixes #26994.

r? @Manishearth

bors added a commit that referenced this issue Jan 23, 2019

Auto merge of #51285 - Mark-Simulacrum:remove-quote_apis, r=Manishearth
Remove quote_*! macros

This deletes a considerable amount of test cases, some of which we may want to keep. I'm not entirely certain what the primary intent of many of them was; if we should keep them I can attempt to edit each case to continue compiling without the quote_*! macros involved.

Fixes #46849.
Fixes #12265.
Fixes #12266.
Fixes #26994.

r? @Manishearth

bors added a commit that referenced this issue Jan 23, 2019

Auto merge of #51285 - Mark-Simulacrum:remove-quote_apis, r=Manishearth
Remove quote_*! macros

This deletes a considerable amount of test cases, some of which we may want to keep. I'm not entirely certain what the primary intent of many of them was; if we should keep them I can attempt to edit each case to continue compiling without the quote_*! macros involved.

Fixes #46849.
Fixes #12265.
Fixes #12266.
Fixes #26994.

r? @Manishearth

bors added a commit that referenced this issue Jan 24, 2019

Auto merge of #51285 - Mark-Simulacrum:remove-quote_apis, r=Manishearth
Remove quote_*! macros

This deletes a considerable amount of test cases, some of which we may want to keep. I'm not entirely certain what the primary intent of many of them was; if we should keep them I can attempt to edit each case to continue compiling without the quote_*! macros involved.

Fixes #46849.
Fixes #12265.
Fixes #12266.
Fixes #26994.

r? @Manishearth

@bors bors closed this in 01f8e25 Jan 24, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.