Skip to content

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

Merged
merged 5 commits into from
Dec 31, 2015

Conversation

est31
Copy link
Member

@est31 est31 commented Dec 29, 2015

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.

@rust-highfive
Copy link
Contributor

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.

@brson
Copy link
Contributor

brson commented Dec 29, 2015

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.

Copy link
Member

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?

Copy link
Member Author

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?

Copy link
Member

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.

@Manishearth
Copy link
Member

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 {
Copy link
Contributor

Choose a reason for hiding this comment

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

wrong whitespace

@brson
Copy link
Contributor

brson commented Dec 29, 2015

@bors r+

@bors
Copy link
Collaborator

bors commented Dec 29, 2015

📌 Commit dea7589 has been approved by brson

@bors
Copy link
Collaborator

bors commented Dec 30, 2015

☔ 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.
@est31 est31 force-pushed the macro_export_help_note branch from dea7589 to 94434f1 Compare December 30, 2015 15:24
@est31
Copy link
Member Author

est31 commented Dec 30, 2015

rebased

@Manishearth
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Dec 30, 2015

📌 Commit 40a9481 has been approved by Manishearth

@bors
Copy link
Collaborator

bors commented Dec 31, 2015

⌛ Testing commit 40a9481 with merge f73c0a8...

bors added a commit that referenced this pull request Dec 31, 2015
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.
@bors bors merged commit 40a9481 into rust-lang:master Dec 31, 2015
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.

6 participants