Skip to content

Fix unsafety in StrInterner #17221

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 15, 2014
Merged

Conversation

bkoropoff
Copy link
Contributor

The StrInterner::clear() method takes self immutably but can invalidate references returned by StrInterner::get_ref. Since get_ref is unused, just remove it.

Closes #17181

The string slices returned by `get_ref` can actually be
invalidated by calling `clear`.  Since this method is unused,
it is easiest to simply remove it.

Closes rust-lang#17181
@bkoropoff
Copy link
Contributor Author

cc @sfackler

bors added a commit that referenced this pull request Sep 15, 2014
The `StrInterner::clear()` method takes self immutably but can invalidate references returned by `StrInterner::get_ref`. Since `get_ref` is unused, just remove it.

Closes #17181
@bors bors closed this Sep 15, 2014
@bors bors merged commit 26d716a into rust-lang:master Sep 15, 2014
@bkoropoff bkoropoff deleted the strinterner-unsafe branch September 20, 2014 21:21
lnicola pushed a commit to lnicola/rust that referenced this pull request May 19, 2024
internal: Lazier macro parse tree validation
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.

StrInterner exposes unsafe functions as safe
3 participants