Skip to content

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

Merged
bors merged 1 commit into
rust-lang:masterfrom
compiler-errors:span
Nov 13, 2023
Merged

Compute layout with spans for better cycle errors in coroutines#117858
bors merged 1 commit into
rust-lang:masterfrom
compiler-errors:span

Conversation

@compiler-errors

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Collaborator

r? @petrochenkov

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

@rustbotrustbot 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
Copy Markdown
ContributorAuthor

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

lcnr commented Nov 13, 2023

Copy link
Copy Markdown
Contributor

r? @lcnr

@bors r+ rollup

@bors

bors commented Nov 13, 2023

Copy link
Copy Markdown
Collaborator

📌 Commit 7994b58 has been approved by lcnr

It is now in the queue for this repository.

@rustbotrustbot assigned lcnr and unassigned petrochenkovNov 13, 2023
@borsbors 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
@TaKO8KiTaKO8Ki mentioned this pull request 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:masterNov 13, 2023
@rustbotrustbot 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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant 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

@compiler-errors@rustbot@rust-log-analyzer@lcnr@bors@petrochenkov