borrowck: Make ConstraintCategory::CallArgument diagnostics pinpoint specific args#158994
borrowck: Make ConstraintCategory::CallArgument diagnostics pinpoint specific args#158994Enselic wants to merge 4 commits into
ConstraintCategory::CallArgument diagnostics pinpoint specific args#158994Conversation
…g new one
So that we in an upcoming commit can return the index into path instead
of a "duplicate".
This passes:
./x test --bless tests/ui --keep-stage-std 1 --set rust.deny-warnings=false
…esConstraint>` This makes the code simpler and easier to understand, since we don't have to partially copy an `OutlivesConstraint` into the `BlameConstraint` struct (which we can remove entirely) and the `BorrowExplanation::MustBeValidFor` enum variant (which we can simplify). Instead, we reference the "best" `OutlivesConstraint` by an index into `Vec<OutlivesConstraint>`. This is not only simpler, it also opens up the possibility for diagnostics to access the full `OutlivesConstraint` info.
5a8879d to
4259c85
Compare
This comment has been minimized.
This comment has been minimized.
…t specific args
Before this commit, `ConstraintCategory::CallArgument` diagnostics would
point to the entire call expression:
LL | let b = bar(f, y);
| ^^^^^^^^^ argument requires that `'a` must outlive `'b`
This commit changes the diagnostics to point to the specific argument
that is causing the lifetime issue:
LL | let b = bar(f, y);
| ^ argument requires that `'a` must outlive `'b`
4259c85 to
eb4f057
Compare
|
@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.
borrowck: Make `ConstraintCategory::CallArgument` diagnostics pinpoint specific args
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (59ef33b): comparison URL. Overall result: ❌ regressions - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in writing along with @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)This perf run didn't have relevant results for this metric. CyclesResults (secondary -4.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.1%, secondary 0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 487.967s -> 489.278s (0.27%) |
|
☔ The latest upstream changes (presumably #159057) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
|
cc @rust-lang/clippy |
This comment was marked as off-topic.
This comment was marked as off-topic.
|
Sorry, fat thumbs on a smartphone made me accidentally click the "ready" button... |
Before this commit,
ConstraintCategory::CallArgumentdiagnostics would point to the entire call expression:This commit changes the diagnostics to point to the specific argument that is causing the lifetime issue:
Draft
This is just a draft and not ready for review. (Although if someone says "this will never work because of ..." I would like to hear that, of course)
I am currently primarily interested in running perf on this, to get a sense for is this can be made to work. If not, there are hopefully other ways to achieve the same end result.
Dependencies
Note that this PR is (partially) stacked on top of the PR #158623.