-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Handle higher-rank lifetimes when generating type IDs #19821
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
Conversation
@@ -5780,128 +5780,162 @@ pub fn trait_item_of_item(tcx: &ctxt, def_id: ast::DefId) | |||
|
|||
/// Creates a hash of the type `Ty` which will be the same no matter what crate | |||
/// context it's calculated within. This is used by the `type_id` intrinsic. | |||
pub fn hash_crate_independent(tcx: &ctxt, ty: Ty, svh: &Svh) -> u64 { | |||
pub fn hash_crate_independent<'tcx>(tcx: &'tcx ctxt, ty: Ty<'tcx>, svh: &Svh) -> u64 { |
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.
This is wrong and I would expect it to cause terrible errors.
'tcx
is the lifetime parameter of ctxt
, not its lifetime - &ctxt<'tcx>
to be precise.
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.
Good catch
8fbae02
to
0b9db9c
Compare
This looks awesome, thanks @bkoropoff! And especially thanks for the thorough tests :) |
My test also uncovered a small pretty printer bug. Bonus! |
r+ -- nice |
328ca1b
to
ec10d6b
Compare
Normalize late-bound regions in bare functions, stack closures, and traits and include them in the generated hash. Closes rust-lang#19791
ec10d6b
to
0a1798d
Compare
Rebased to resolve merge conflicts and hoisted Need r=nikomatsakis |
Normalize late-bound regions in bare functions, stack closures, and traits and include them in the generated hash. Closes #19791 r? @nikomatsakis (does my normalization make sense?) cc @alexcrichton
Normalize late-bound regions in bare functions, stack closures, and traits and include them in the generated hash. Closes rust-lang#19791 r? @nikomatsakis (does my normalization make sense?) cc @alexcrichton
Normalize late-bound regions in bare functions, stack closures, and traits and include them in the generated hash.
Closes #19791
r? @nikomatsakis (does my normalization make sense?)
cc @alexcrichton