-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Rewrite TypeId computation to not miss anything and work cross-crate. #35267
Conversation
r? @nrc (rust_highfive has picked a reviewer for you, use r? to override) |
@@ -525,6 +393,142 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { | |||
} | |||
} | |||
|
|||
struct TypeIdHasher<'a, 'gcx: 'a+'tcx, 'tcx: 'a> { | |||
tcx: TyCtxt<'a, 'gcx, 'tcx>, | |||
svh: &'a Svh, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably we should just be hashing the crate-name/crate-discriminant pair, rather than employing the SVH.
Why is that scary? It seems... right to me. The Note that the |
@bors r+ |
📌 Commit 7bef809 has been approved by |
@bors r=nikomatsakis |
📌 Commit d42da7b has been approved by |
Rewrite TypeId computation to not miss anything and work cross-crate. Fixes #33703 and also some soundness holes in `Any` due to `TypeId` ignoring most lifetimes.
Fixes #33703 and also some soundness holes in
Any
due toTypeId
ignoring most lifetimes.