Feed ErrorGuaranteed from late lifetime resolution errors through to bound variable resolution#152076
Feed ErrorGuaranteed from late lifetime resolution errors through to bound variable resolution#152076eggyal wants to merge 1 commit intorust-lang:mainfrom
ErrorGuaranteed from late lifetime resolution errors through to bound variable resolution#152076Conversation
|
Changes to the size of AST and/or HIR nodes. cc @nnethercote |
|
|
There was a problem hiding this comment.
Thanks for working on this! I won't be able to review this tonight but I'd like to note that thanks to your changes we should now be able to get rid of the minor hack in HIR ty lowering as I've mentioned in the issue:
rust/compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_trait.rs
Lines 454 to 464 in f60a0f1
(by replacing that whole snippet with just RegionInferReason::ObjectLifetimeDefault)
This comment was marked as resolved.
This comment was marked as resolved.
|
Preliminary sanity perf check due to size changes. @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Bind undeclared lifetimes as erroneous bound vars
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (e81e54f): comparison URL. Overall result: ❌ regressions - no action neededBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 3.1%, secondary -0.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 472.721s -> 472.345s (-0.08%) |
|
HIR ty lowering was modified cc @fmease |
e7d86b7 to
a531436
Compare
There was a problem hiding this comment.
Whereas in 08ed1a1 (now fa5cccf) I was only feeding ErrorGuaranteed through to RBV in the specific case of undeclared named lifetimes, in a531436 (now 8e83a57) I've extended the logic to feed through such an ErrorGuaranteed for every early lifetime resolution error. This enables the aforementioned "hack" to be removed without giving rise to new instances of E0228 ("the lifetime bound for this object type cannot be deduced from context"), however it does also suppress a few other errors that previously were emitted—see updates to test outputs.
View changes since this review
I didn't squash (yet) in case you had begun reviewing and it was easier to see what has since changed. However, these commits really ought to be squashed (with commensurate updates to the PR description and commit comments) before merging, and review may be easier combined in any event.
ErrorGuaranteed from early lifetime resolution errors through to bound variable resolution
This comment has been minimized.
This comment has been minimized.
|
Reminder, once the PR becomes ready for a review, use |
da3dc12 to
12e283b
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment has been minimized.
This comment has been minimized.
12e283b to
1377613
Compare
This comment has been minimized.
This comment has been minimized.
This comment was marked as outdated.
This comment was marked as outdated.
1377613 to
f9725d5
Compare
|
I've responded to the rustdoc issue in that comment thread, but GitHub isn't rendering that (for me) on this page. @rustbot ready |
There was a problem hiding this comment.
Thanks! I've just noticed that you've pushed another commit while I was in the midst of reviewing. As I've noted in this review comment you couldn't see yet, I'm actually fine with this "breaking" rustdoc change. My initial concern is unsubstantial.
I'll put it into the queue once you've dropped the RustdocSuppressedError change again (I'm sorry ^^'), impl'ed my suggestions and finally squashed the commits (as you've already offered :D).
If late lifetime resolution fails for whatever reason, forward to RBV the guarantee that an error was emitted - thereby eliminating the need for a "hack" to suppress subsequent/superfluous error diagnostics.
9135d8f to
c43a33e
Compare
|
Thank you for all the excellent feedback—it's a much better PR as a result! ❤️ @rustbot ready |
ErrorGuaranteed from early lifetime resolution errors through to bound variable resolutionErrorGuaranteed from late lifetime resolution errors through to bound variable resolution
There was a problem hiding this comment.
Thanks for these kind works & thanks again for having worked on this!
@bors r+ rollup-
If late lifetime resolution fails for whatever reason, forward to RBV the guarantee that an error was emitted - thereby eliminating the need for a "hack" to suppress subsequent/superfluous error diagnostics.
Fixes #152014
r? fmease