Skip to content

Add check on find_best_match_for_name and improve help message for undefined macro #31707

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 1 commit into from
Feb 18, 2016

Conversation

GuillaumeGomez
Copy link
Member

I'm wondering if instead of a second help message, a note would be better. I let it up to reviewers.
#31660

@rust-highfive
Copy link
Contributor

r? @sfackler

(rust_highfive has picked a reviewer for you, use r? to override)


fn main() {
k!(); //~ ERROR macro undefined: 'k!'
//~^ HELP did you mean `kl!`?
Copy link
Member

Choose a reason for hiding this comment

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

I'm assuming compiletest can't check help messages? Derp, shouldn't this be checking for the "have you added..." line as well?

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 added it afterward and I'm still waiting an opinion on it. But if it's good as it is right now, then yes.

@sfackler
Copy link
Member

It seems a bit weird that the message would suggest a better name, but if you switch to that one you'll get another error since it wasn't macro_used. Do we track enough information to add in the "don't forget to add #[macro_use]" message only when necessary?

@GuillaumeGomez
Copy link
Member Author

In #31660, it's solved with #[macro_use]. But I'm not sure we could check this so easily...

@GuillaumeGomez
Copy link
Member Author

Actually, if the suggested name is the same, we can assume that it's this kind of error.

@GuillaumeGomez
Copy link
Member Author

@sfackler: It seems way better like this. What do you think?

@sfackler
Copy link
Member

Yep, this looks good to me.

@bors r+

@bors
Copy link
Collaborator

bors commented Feb 17, 2016

📌 Commit eca0ab2 has been approved by sfackler

@bors
Copy link
Collaborator

bors commented Feb 17, 2016

⌛ Testing commit eca0ab2 with merge 4d3eebf...

bors added a commit that referenced this pull request Feb 17, 2016
I'm wondering if instead of a second help message, a note would be better. I let it up to reviewers.
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.

4 participants