Skip to content
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

Replace assertions in Puctuated with more helpful panic messages #970

Merged
merged 1 commit into from Mar 5, 2021

Conversation

osa1
Copy link
Contributor

@osa1 osa1 commented Feb 23, 2021

Debugging proc macros is very difficult as we can't easily get
backtraces into the proc macro code. Improved error messages will
hopefully give some hint to the user on what the problem is.

@zzau13
Copy link

zzau13 commented Feb 23, 2021

Can use https://doc.rust-lang.org/std/macro.assert.html like assert!(some, format_args). I think it's more correct than panic!.

Debugging proc macros is very difficult as we can't easily get
backtraces into the proc macro code. Improved error messages will
hopefully give some hint to the user on what the problem is.
@osa1
Copy link
Contributor Author

osa1 commented Feb 23, 2021

Huh.. I didn't even know assert! can take multiple arguments. I updated the PR.

Copy link
Owner

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

Thanks!

@dtolnay dtolnay merged commit a782687 into dtolnay:master Mar 5, 2021
@osa1 osa1 deleted the helpful_asserts branch March 5, 2021 08:02
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.

None yet

3 participants