Skip to content
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

Compute layout with spans for better cycle errors in coroutines #117858

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

compiler-errors
Copy link
Member

Split out from #117703, this PR at least gives us a nicer span to point at when we hit a cycle error in coroutine layout cycles.

@rustbot
Copy link
Collaborator

rustbot commented Nov 13, 2023

r? @petrochenkov

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 13, 2023
let (awaitee_pat, awaitee_pat_hid) =
self.pat_ident_binding_mode(span, awaitee_ident, hir::BindingAnnotation::MUT);
let (awaitee_pat, awaitee_pat_hid) = self.pat_ident_binding_mode(
gen_future_span,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we use the whole expression span here rather than the span of the .await, when pointing to the local that we use to store the IntoFuture::into_future result. That's because the user probably cares more about the whole async call, not just the fact that the future was awaited.

This matters a lot more when pointing out recursive calls in #117703, but it does make the span a bit better here too.

@rust-log-analyzer

This comment has been minimized.

@lcnr
Copy link
Contributor

lcnr commented Nov 13, 2023

r? @lcnr

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Nov 13, 2023

📌 Commit 7994b58 has been approved by lcnr

It is now in the queue for this repository.

@rustbot rustbot assigned lcnr and unassigned petrochenkov Nov 13, 2023
@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 13, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 13, 2023
Rollup of 5 pull requests

Successful merges:

 - rust-lang#117737 (Remove `-Zkeep-hygiene-data`.)
 - rust-lang#117830 (Small improvements in object lifetime default code)
 - rust-lang#117858 (Compute layout with spans for better cycle errors in coroutines)
 - rust-lang#117863 (Remove some unused stuff from `rustc_index`)
 - rust-lang#117872 (Cranelift isn't available on non-nightly channels)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit cf21b6e into rust-lang:master Nov 13, 2023
11 checks passed
@rustbot rustbot added this to the 1.76.0 milestone Nov 13, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 13, 2023
Rollup merge of rust-lang#117858 - compiler-errors:span, r=lcnr

Compute layout with spans for better cycle errors in coroutines

Split out from rust-lang#117703, this PR at least gives us a nicer span to point at when we hit a cycle error in coroutine layout cycles.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants