Skip to content

Add some consistency checks for value interning in ty::ctxt. #30135

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
Dec 1, 2015

Conversation

michaelwoerister
Copy link
Member

This PR adds some safety checks to interning things in ty::ctxt. Accidentally re-interning an AdtDef has bitten me in the behind just last week (it messes up things in very subtle way only showing up later as an LLVM assertion).

Initially I had also added a check to ty::ctxt::node_type_insert() -- but there it seems to be expected that the same table slot is written to multiple times.

Roll-up candidate.

@rust-highfive
Copy link
Contributor

r? @Aatch

(rust_highfive has picked a reviewer for you, use r? to override)

@sanxiyn
Copy link
Member

sanxiyn commented Dec 1, 2015

@bors r+

@bors
Copy link
Collaborator

bors commented Dec 1, 2015

📌 Commit f6a1db6 has been approved by sanxiyn

@bors
Copy link
Collaborator

bors commented Dec 1, 2015

⌛ Testing commit f6a1db6 with merge 4dda364...

bors added a commit that referenced this pull request Dec 1, 2015
This PR adds some safety checks to interning things in `ty::ctxt`. Accidentally re-interning an `AdtDef` has bitten me in the behind just last week (it messes up things in very subtle way only showing up later as an LLVM assertion).

Initially I had also added a check to `ty::ctxt::node_type_insert()` -- but there it seems to be expected that the same table slot is written to multiple times.

Roll-up candidate.
@bors bors merged commit f6a1db6 into rust-lang:master Dec 1, 2015
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.

5 participants