Skip to content

Don't leak a TokenStream in Ctxt::emit_errors. #2

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
Sep 20, 2019
Merged

Don't leak a TokenStream in Ctxt::emit_errors. #2

merged 1 commit into from
Sep 20, 2019

Conversation

eddyb
Copy link
Contributor

@eddyb eddyb commented Sep 19, 2019

This was found by crater on rust-lang/rust#63809 (results at rust-lang/rust#64398 (comment)).

While there is no resource leak being caused (as proc_macro "objects" get cleaned up anyway), we might want rustc to warn/error in such cases because they can also be caused by keeping a proc_macro "object" (such as a TokenStream) for longer than the scope of the proc macro invocation.

tesaguri added a commit that referenced this pull request Sep 20, 2019
* patch-1:
  Don't leak a TokenStream in Ctxt::emit_errors.
@tesaguri tesaguri merged commit b6536b1 into tesaguri:master Sep 20, 2019
@tesaguri
Copy link
Owner

Thank you!

Published as v0.3.1 and backported to v0.2.3.

@eddyb eddyb deleted the patch-1 branch September 26, 2019 13:28
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