-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Custom help message for people trying to make macro public #30598
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
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
I like it. Opinions @nikomatsakis @Manishearth ? |
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a parse-fail test instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll move it.
Should I move the files src/test/compile-fail/pub-item-macro.rs
and src/test/compile-fail/pub-method-macro.rs
too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If they deal with errors that come from the parser (looks like they do?), then yes.
r=me once the test is moved |
self.span_err(span, "can't qualify macro invocation with `pub`"); | ||
self.fileline_help(span, "try adjusting the macro to put `pub` inside \ | ||
the invocation"); | ||
let is_macro_rules :bool = match self.token { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrong whitespace
@bors r+ |
📌 Commit dea7589 has been approved by |
☔ The latest upstream changes (presumably #30542) made this pull request unmergeable. Please resolve the merge conflicts. |
The current help message is too much about "normal" macros to be used as general message. Keep it for normal macros, and add custom help and error messages for macro definitions.
dea7589
to
94434f1
Compare
rebased |
@bors r+ |
📌 Commit 40a9481 has been approved by |
The current help message is too much about "normal" macros to be used as general message. Keep it for normal macros, and add custom help and error messages for macro definitions.
The current help message is too much about "normal" macros to be used
as general message. Keep it for normal macros, and add custom help and
error messages for macro definitions.