-
Notifications
You must be signed in to change notification settings - Fork 13.3k
"macro expansion ignores" error should explain why #22425
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
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-macros
Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Comments
bors
added a commit
that referenced
this issue
Apr 7, 2015
Addresses issue #22425. See `src/test/compile-fail/macro-incomplete-parse.rs` for a relevant test: macro-incomplete-parse.rs:15:9: 15:10 error: macro expansion ignores token `,` and any following macro-incomplete-parse.rs:15 , //~ ERROR macro expansion ignores token `,` ^ macro-incomplete-parse.rs:27:1: 27:17 note: caused by the macro expansion here; the usage of `ignored_item` is likely invalid in this context macro-incomplete-parse.rs:27 ignored_item!(); ^~~~~~~~~~~~~~~~ macro-incomplete-parse.rs:20:14: 20:15 error: macro expansion ignores token `,` and any following macro-incomplete-parse.rs:20 () => ( 1, 2 ) //~ ERROR macro expansion ignores token `,` ^ macro-incomplete-parse.rs:30:5: 30:21 note: caused by the macro expansion here; the usage of `ignored_expr` is likely invalid in this context macro-incomplete-parse.rs:30 ignored_expr!(); ^~~~~~~~~~~~~~~~ macro-incomplete-parse.rs:24:14: 24:15 error: macro expansion ignores token `,` and any following macro-incomplete-parse.rs:24 () => ( 1, 2 ) //~ ERROR macro expansion ignores token `,` ^ macro-incomplete-parse.rs:32:9: 32:23 note: caused by the macro expansion here; the usage of `ignored_pat` is likely invalid in this context macro-incomplete-parse.rs:32 ignored_pat!() => (), ^~~~~~~~~~~~~~ This does not address the case of improper expansion inside of an impl { } as seen in issue #21607. I'm not sure if the note text is ideal, but it can be refined if needed.
bors
added a commit
that referenced
this issue
Apr 8, 2015
Addresses issue #22425. See `src/test/compile-fail/macro-incomplete-parse.rs` for a relevant test: macro-incomplete-parse.rs:15:9: 15:10 error: macro expansion ignores token `,` and any following macro-incomplete-parse.rs:15 , //~ ERROR macro expansion ignores token `,` ^ macro-incomplete-parse.rs:27:1: 27:17 note: caused by the macro expansion here; the usage of `ignored_item` is likely invalid in this context macro-incomplete-parse.rs:27 ignored_item!(); ^~~~~~~~~~~~~~~~ macro-incomplete-parse.rs:20:14: 20:15 error: macro expansion ignores token `,` and any following macro-incomplete-parse.rs:20 () => ( 1, 2 ) //~ ERROR macro expansion ignores token `,` ^ macro-incomplete-parse.rs:30:5: 30:21 note: caused by the macro expansion here; the usage of `ignored_expr` is likely invalid in this context macro-incomplete-parse.rs:30 ignored_expr!(); ^~~~~~~~~~~~~~~~ macro-incomplete-parse.rs:24:14: 24:15 error: macro expansion ignores token `,` and any following macro-incomplete-parse.rs:24 () => ( 1, 2 ) //~ ERROR macro expansion ignores token `,` ^ macro-incomplete-parse.rs:32:9: 32:23 note: caused by the macro expansion here; the usage of `ignored_pat` is likely invalid in this context macro-incomplete-parse.rs:32 ignored_pat!() => (), ^~~~~~~~~~~~~~ This does not address the case of improper expansion inside of an impl { } as seen in issue #21607. I'm not sure if the note text is ideal, but it can be refined if needed.
Is this fixed? I think this was fixed the referenced pull request. |
I'd prefer a message like |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-macros
Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
afaik, it's because the context where you're using the macro (expr, item, etc.) stopped parsing before that token. We should mention that context.
The text was updated successfully, but these errors were encountered: