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

Hide panic output in nightly_works #123

Merged
merged 2 commits into from
Sep 2, 2018
Merged

Hide panic output in nightly_works #123

merged 2 commits into from
Sep 2, 2018

Conversation

dtolnay
Copy link
Owner

@dtolnay dtolnay commented Sep 1, 2018

Fixes #122.

@alexcrichton
Copy link
Contributor

Nice! I've been hesitant to implement this solution before due to the race with other libraries (not within proc-macro2, but across crates).

It's true that this is likely gonna be fine in practice 99% of the time, but I'd personally err on the side of "100% correct, 'meh' output sometimes" rather than "99% correct, but friendly output all the time". That being said though I don't feel too too strongly on this.

Could we perhaps implement some sort of sanity check to see if the hook we get back out is the same temporary one that we inserted? Maybe panic if there's a mismatch?

@dtolnay
Copy link
Owner Author

dtolnay commented Sep 2, 2018

Makes sense. I added a sanity check by comparing the pointer value before and after.

@alexcrichton alexcrichton merged commit 311f788 into dtolnay:master Sep 2, 2018
@dtolnay dtolnay deleted the panic branch September 2, 2018 02:27
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.

2 participants