-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Rework name_regions
to not rely on reverse scc graph for non-member-constrain usages
#137102
Conversation
r? @nnethercote rustbot has assigned @nnethercote. Use |
/// that universal region. This is useful for member region constraints since | ||
/// we want to suggest a universal region name to capture even if it's technically | ||
/// not equal to the error region. | ||
pub(crate) fn name_regions_for_member_constraint<T>(&self, tcx: TyCtxt<'tcx>, ty: T) -> T |
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 one stays living in regioncx bc it's paired with its partner function above.
r? oli-obk who (i think) knows about borrowck error reporting, but reassign if you don't want to review it |
Heh fun. From the description I assumed it would also fix some weird diagnostic, but I guess those were "avoided" by the ice. @bors r+ rollup |
…li-obk Rework `name_regions` to not rely on reverse scc graph for non-member-constrain usages Fixes rust-lang#137015 Splits the `name_regions` into two versions: One meant for member region constraint error reporting (which I've renamed to `name_regions_for_member_constraint`), and one meant *just* to replace region vids with an external region. Use the latter in the usage sites I added in rust-lang#136559, since the regions returned by `name_regions_for_member_constraint` are also not *totally* accurate (which is fine for how they're used for member region constraint error reporting -- they're intentionally returning overapproximated universal regions so that we have something to name in `+ use<'a>` suggestions, because opaques can only capture universal regions and since member region constraints don't insert any edges into the region graph, the error region is probably gonna be shorter than a universal region) and because that function requires the reverse scc graph to have been computed which isn't done for our usages in rust-lang#136559.
…li-obk Rework `name_regions` to not rely on reverse scc graph for non-member-constrain usages Fixes rust-lang#137015 Splits the `name_regions` into two versions: One meant for member region constraint error reporting (which I've renamed to `name_regions_for_member_constraint`), and one meant *just* to replace region vids with an external region. Use the latter in the usage sites I added in rust-lang#136559, since the regions returned by `name_regions_for_member_constraint` are also not *totally* accurate (which is fine for how they're used for member region constraint error reporting -- they're intentionally returning overapproximated universal regions so that we have something to name in `+ use<'a>` suggestions, because opaques can only capture universal regions and since member region constraints don't insert any edges into the region graph, the error region is probably gonna be shorter than a universal region) and because that function requires the reverse scc graph to have been computed which isn't done for our usages in rust-lang#136559.
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#125087 (Optimize `Seek::stream_len` impl for `File`) - rust-lang#136986 (Apply unsafe_op_in_unsafe_fn to the standard library) - rust-lang#137012 (add docs and ut for bootstrap util cc-detect) - rust-lang#137072 (Load all builtin targets at once instead of one by one in check-cfg) - rust-lang#137102 (Rework `name_regions` to not rely on reverse scc graph for non-member-constrain usages) - rust-lang#137112 (Don't project into `NonNull` when dropping a `Box`) - rust-lang#137114 (Add an example for `std::error::Error`) - rust-lang#137117 (Fix test that relies on error language) - rust-lang#137119 (fix broken `x {doc, build} core`) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#136986 (Apply unsafe_op_in_unsafe_fn to the standard library) - rust-lang#137012 (add docs and ut for bootstrap util cc-detect) - rust-lang#137072 (Load all builtin targets at once instead of one by one in check-cfg) - rust-lang#137102 (Rework `name_regions` to not rely on reverse scc graph for non-member-constrain usages) - rust-lang#137112 (Don't project into `NonNull` when dropping a `Box`) - rust-lang#137114 (Add an example for `std::error::Error`) - rust-lang#137117 (Fix test that relies on error language) - rust-lang#137119 (fix broken `x {doc, build} core`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#137102 - compiler-errors:name_regions2, r=oli-obk Rework `name_regions` to not rely on reverse scc graph for non-member-constrain usages Fixes rust-lang#137015 Splits the `name_regions` into two versions: One meant for member region constraint error reporting (which I've renamed to `name_regions_for_member_constraint`), and one meant *just* to replace region vids with an external region. Use the latter in the usage sites I added in rust-lang#136559, since the regions returned by `name_regions_for_member_constraint` are also not *totally* accurate (which is fine for how they're used for member region constraint error reporting -- they're intentionally returning overapproximated universal regions so that we have something to name in `+ use<'a>` suggestions, because opaques can only capture universal regions and since member region constraints don't insert any edges into the region graph, the error region is probably gonna be shorter than a universal region) and because that function requires the reverse scc graph to have been computed which isn't done for our usages in rust-lang#136559.
Fixes #137015
Splits the
name_regions
into two versions: One meant for member region constraint error reporting (which I've renamed toname_regions_for_member_constraint
), and one meant just to replace region vids with an external region.Use the latter in the usage sites I added in #136559, since the regions returned by
name_regions_for_member_constraint
are also not totally accurate (which is fine for how they're used for member region constraint error reporting -- they're intentionally returning overapproximated universal regions so that we have something to name in+ use<'a>
suggestions, because opaques can only capture universal regions and since member region constraints don't insert any edges into the region graph, the error region is probably gonna be shorter than a universal region) and because that function requires the reverse scc graph to have been computed which isn't done for our usages in #136559.