-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Creating a trait function with a macro using block designator: error: expected ;
or {
, found { ... }
#54707
Comments
If no one is working on this, I'll take it. |
pietroalbini
added a commit
to pietroalbini/rust
that referenced
this issue
Oct 9, 2018
…m-macro, r=nikomatsakis Fix rust-lang#54707 - parse_trait_item_ now handles interpolated blocks as function body decls Fix rust-lang#54707 - parse_trait_item_ now handles interpolated blocks as function body decls Previously parsing trait items only handled opening brace token and semicolon, I added a branch to the match statement that will also handle interpolated blocks.
pietroalbini
added a commit
to pietroalbini/rust
that referenced
this issue
Oct 10, 2018
…m-macro, r=nikomatsakis Fix rust-lang#54707 - parse_trait_item_ now handles interpolated blocks as function body decls Fix rust-lang#54707 - parse_trait_item_ now handles interpolated blocks as function body decls Previously parsing trait items only handled opening brace token and semicolon, I added a branch to the match statement that will also handle interpolated blocks.
bors
added a commit
that referenced
this issue
Oct 11, 2018
Rollup of 9 pull requests Successful merges: - #54747 (codegen_llvm: verify that inline assembly operands are scalars) - #54848 (Better Diagnostic for Trait Object Capture) - #54850 (Fix #54707 - parse_trait_item_ now handles interpolated blocks as function body decls) - #54858 (second round of refactorings for universes) - #54862 (Implement RFC 2539: cfg_attr with multiple attributes) - #54869 (Fix mobile docs) - #54870 (Stabilize tool lints) - #54893 (Fix internal compiler error on malformed match arm pattern.) - #54904 (Stabilize the `Option::replace` method) Failed merges: - #54909 ( Add chalk rules related to associated type defs) r? @ghost
bors
added a commit
that referenced
this issue
Oct 11, 2018
Rollup of 9 pull requests Successful merges: - #54747 (codegen_llvm: verify that inline assembly operands are scalars) - #54848 (Better Diagnostic for Trait Object Capture) - #54850 (Fix #54707 - parse_trait_item_ now handles interpolated blocks as function body decls) - #54858 (second round of refactorings for universes) - #54862 (Implement RFC 2539: cfg_attr with multiple attributes) - #54869 (Fix mobile docs) - #54870 (Stabilize tool lints) - #54893 (Fix internal compiler error on malformed match arm pattern.) - #54904 (Stabilize the `Option::replace` method) Failed merges: - #54909 ( Add chalk rules related to associated type defs) r? @ghost
bors
added a commit
that referenced
this issue
Oct 11, 2018
…nikomatsakis Fix #54707 - parse_trait_item_ now handles interpolated blocks as function body decls Fix #54707 - parse_trait_item_ now handles interpolated blocks as function body decls Previously parsing trait items only handled opening brace token and semicolon, I added a branch to the match statement that will also handle interpolated blocks.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Given a simple macro:
I can use it without problems to define a function:
I can also use it to define a struct method without problems:
However when I try to use it to define a default method for a trait it doesn't work:
It gives an error message:
If I change the macro to include braces around
$body
it works:I have no idea why this happens but I guess it is some sort of bug in how default trait methods are parsed.
The text was updated successfully, but these errors were encountered: