Uh oh!
There was an error while loading. Please reload this page.
Region naming refactoring [6/N] - #67476
Conversation
This comment has been minimized.
This comment has been minimized.
rust-highfive
commented
Dec 21, 2019
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
c49dab5 to
1a58035Comparerust-highfive
commented
Dec 21, 2019
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
1a58035 to
d7e6fc3Comparerust-highfive
commented
Dec 23, 2019
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
rust-highfive
commented
Dec 23, 2019
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
bors
commented
Dec 23, 2019
☔ The latest upstream changes (presumably #67540) made this pull request unmergeable. Please resolve the merge conflicts. |
36151eb to
d09d949Comparerust-highfive
commented
Dec 23, 2019
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
d09d949 to
8161024Comparerust-highfive
commented
Dec 28, 2019
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
rust-highfive
commented
Dec 29, 2019
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
@matthewjasper@eddyb Ok, this looks ready for review, though it is still waiting for the previous PR to merge. The major changes in this PR include:
The PR is rather large, but the commits are fairly self-contained (though they don't all compile). There was one minor output change to one test with Between this PR and the last one, a net of 200 lines are removed, most of which was function parameters and context structs 🎉 EDIT: also copied this ^^ to the OP... |
mark-i-m
commented
Dec 29, 2019
Oh, forgot to mention: I realize this is a big PR, and I can think of at least 3 smaller PRs that this could be split into if you would like (though I would prefer to get it over with :P) |
bors
commented
Dec 30, 2019
☔ The latest upstream changes (presumably #66942) made this pull request unmergeable. Please resolve the merge conflicts. |
f8ae596 to
b5a6656Comparemark-i-m
commented
Dec 30, 2019
@rustbot modify labels: +S-waiting-on-review -S-blocked |
bebda54 to
f05e40eComparemark-i-m
commented
Jan 15, 2020
@rustbot modify labels: +S-waiting-on-review -S-waiting-on-author |
eddyb
commented
Jan 16, 2020
The diffs in the PR description make me very confused as to why this wasn't done from the start. |
matthewjasper
commented
Jan 17, 2020
Is bors not looking at reviews? @bors r+ |
bors
commented
Jan 17, 2020
📌 Commit f05e40e has been approved by |
bors
commented
Jan 17, 2020
Region naming refactoring [6/N] Followup to #67474 EDIT: this PR is probably best read commit-by-commit... The major changes in this PR include: - moving many functions around to modules that better suit them. In particular, a lot of methods were moved from `borrow_check::diagnostics::region_errors` to `borrow_check::region_infer`, and `report_region_errors` was moved from `borrow_check` to `borrow_check::diagnostics::region_errors`. - `borrow_check::diagnostics::{region_errors, region_name}` are now most comprised of methods on `MirBorrowckCtxt` instead of `RegionInferenceContext`, allowing us to get rid of the annoying `pub(in crate::borrow_check)` on most of the fields of the latter, along with a number of method arguments on many methods. - I renamed `MirBorrowckCtxt.nonlexical_regioncx` to just `regioncx` because their is no lexical lifetimes any more, and the old name was annoyingly verbose, causing many lines to wrap unnecessarily. - I got rid of `ErrorRegionNamingContext`. Region naming is implemented as inherent methods on `MirBorrowckCtxt`, so we just move the naming stuff into that struct. The PR is rather large, but the commits are fairly self-contained (though they don't all compile). There was one minor output change to one test with `compare-mode=nll`, which I think is acceptable. Between this PR and the last one, a net of 200 lines are removed, most of which was function parameters and context structs :tada: Some samples: ```diff - self.nonlexical_regioncx.free_region_constraint_info( - &self.body, - &self.local_names, - &self.upvars, - self.mir_def_id, - self.infcx, - borrow_region_vid, - region, - ); + self.free_region_constraint_info(borrow_region_vid, region); ``` ```diff - .or_else(|| { - self.give_name_if_anonymous_region_appears_in_yield_ty( - infcx, - body, - *mir_def_id, - fr, - renctx, - ) - }); + .or_else(|| self.give_name_if_anonymous_region_appears_in_arguments(fr)) ``` r? @matthewjasper cc @eddyb
nikomatsakis
commented
Jan 17, 2020
I didn't read too closely, but sounds great! ❤️ |
bors
commented
Jan 18, 2020
☀️ Test successful - checks-azure |
Followup to #67474
EDIT: this PR is probably best read commit-by-commit...
The major changes in this PR include:
borrow_check::diagnostics::region_errorstoborrow_check::region_infer, andreport_region_errorswas moved fromborrow_checktoborrow_check::diagnostics::region_errors.borrow_check::diagnostics::{region_errors, region_name}are now most comprised of methods onMirBorrowckCtxtinstead ofRegionInferenceContext, allowing us to get rid of the annoyingpub(in crate::borrow_check)on most of the fields of the latter, along with a number of method arguments on many methods.MirBorrowckCtxt.nonlexical_regioncxto justregioncxbecause their is no lexical lifetimes any more, and the old name was annoyingly verbose, causing many lines to wrap unnecessarily.ErrorRegionNamingContext. Region naming is implemented as inherent methods onMirBorrowckCtxt, so we just move the naming stuff into that struct.The PR is rather large, but the commits are fairly self-contained (though they don't all compile). There was one minor output change to one test with
compare-mode=nll, which I think is acceptable.Between this PR and the last one, a net of 200 lines are removed, most of which was function parameters and context structs 🎉
Some samples:
r? @matthewjasper
cc @eddyb