-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Improve span for consider adding an explicit lifetime bound
suggestions under NLL
#96352
Improve span for consider adding an explicit lifetime bound
suggestions under NLL
#96352
Conversation
r? @oli-obk (rust-highfive has picked a reviewer for you, use r? to override) |
r? @jackh726 |
Looks good :) need to compare nll vs base before I r+ though Why wouldn't this close #96332 |
Because while I was investigating this, I realized that under NLL those suggestions are missing a part:
but also a note:
I do believe this PR is a step in the right direction, but imo is not enough to recover everything lost under NLL. |
…ions under NLL Because NLL borrowck is run after typeck, `in_progress_typeck_results` was always `None` which was preventing the retrieval of the span to which the suggestion is suppose to add the lifetime bound. We now manually pass the `LocalDefId` owner to `construct_generic_bound_failure` so that under NLL, we give the owner id of the current body.
22f53b6
to
53120b5
Compare
Actually, I think I've just solved that first problem with the second commit.
|
📌 Commit 53120b5 has been approved by |
@bors r- needs rebase |
@bors r+ |
📌 Commit 8d561d2 has been approved by |
…askrgr Rollup of 5 pull requests Successful merges: - rust-lang#94893 (diagnostics: regression test for `<usize as Iterator>::rev`) - rust-lang#95504 (Add `x {check,build,doc} {compiler,library}` aliases.) - rust-lang#96237 (compiletest: combine `--*-python` args) - rust-lang#96303 (Improve bootstrap tests) - rust-lang#96352 (Improve span for `consider adding an explicit lifetime bound` suggestions under NLL) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Because NLL borrowck is run after typeck,
in_progress_typeck_results
was alwaysNone
which was preventing the retrieval of the span to which the suggestion is suppose to add the lifetime bound.We now manually pass the
LocalDefId
owner toconstruct_generic_bound_failure
so that under NLL, we give the owner id of the current body.This helps with #96332