Skip to content

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.

3 participants