-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Introduce a FreeRegionMap
to store relations between free regions
#24553
Introduce a FreeRegionMap
to store relations between free regions
#24553
Conversation
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
r? @pnkfelix |
table, introduce a `FreeRegionMap` data structure. regionck computes the `FreeRegionMap` for each fn and stores the result into the tcx so that borrowck can use it (this could perhaps be refactored to have borrowck recompute the map, but it's a bid tedious to recompute due to the interaction of closures and free fns). The main reason to do this is because of rust-lang#22779 -- using a global table was incorrect because when validating impl method signatures, we want to use the free region relationships from the *trait*, not the impl. Fixes rust-lang#22779.
8c41bc0
to
6dfeda7
Compare
soundness fix; niko considers low-risk. going from nominated to (nominated, accepted) (and I need to get my butt going reviewing it.) |
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
//! This file defines |
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.
The file defines ... what? What? You leave me in suspense!
Okay, this all looks good. I had some nits about the comments but honestly I'd rather just try to land this now if possible. :) |
… r=pnkfelix Rather than storing the relations between free-regions in a global table, introduce a `FreeRegionMap` data structure. regionck computes the `FreeRegionMap` for each fn and stores the result into the tcx so that borrowck can use it (this could perhaps be refactored to have borrowck recompute the map, but it's a bid tedious to recompute due to the interaction of closures and free fns). The main reason to do this is because of #22779 -- using a global table was incorrect because when validating impl method signatures, we want to use the free region relationships from the *trait*, not the impl. Fixes #22779.
💔 Test failed - auto-mac-32-opt |
|
@bors p=1 |
⌛ Testing commit 55ffd2e with merge f9e53c7... |
… r=pnkfelix Rather than storing the relations between free-regions in a global table, introduce a `FreeRegionMap` data structure. regionck computes the `FreeRegionMap` for each fn and stores the result into the tcx so that borrowck can use it (this could perhaps be refactored to have borrowck recompute the map, but it's a bid tedious to recompute due to the interaction of closures and free fns). The main reason to do this is because of #22779 -- using a global table was incorrect because when validating impl method signatures, we want to use the free region relationships from the *trait*, not the impl. Fixes #22779.
table, introduce a `FreeRegionMap` data structure. regionck computes the `FreeRegionMap` for each fn and stores the result into the tcx so that borrowck can use it (this could perhaps be refactored to have borrowck recompute the map, but it's a bid tedious to recompute due to the interaction of closures and free fns). The main reason to do this is because of rust-lang#22779 -- using a global table was incorrect because when validating impl method signatures, we want to use the free region relationships from the *trait*, not the impl. Fixes rust-lang#22779. ---- This is cherry-pick of commit 6dfeda7 from PR rust-lang#24553 Manually resolved conflicts in: src/librustc/lib.rs src/librustc/middle/infer/region_inference/mod.rs (both conflicts were related to changes to file structure.)
This is a cherry-pick of commit 55ffd2e from PR rust-lang#24553
This is cherry-pick of commit 55ffd2e from PR rust-lang#24553
cherry-pick of PR #24553 to [beta]
Rather than storing the relations between free-regions in a global
table, introduce a
FreeRegionMap
data structure. regionck computes theFreeRegionMap
for each fn and stores the result into the tcx so thatborrowck can use it (this could perhaps be refactored to have borrowck
recompute the map, but it's a bid tedious to recompute due to the
interaction of closures and free fns). The main reason to do this is
because of #22779 -- using a global table was incorrect because when
validating impl method signatures, we want to use the free region
relationships from the trait, not the impl.
Fixes #22779.