Skip to content

borrowck: handle CoroutineClosure in describe_field and moved-closure notes#576

Open
SebTardif wants to merge 1 commit into
mainfrom
fix-r71-diag-coroutine-closure
Open

borrowck: handle CoroutineClosure in describe_field and moved-closure notes#576
SebTardif wants to merge 1 commit into
mainfrom
fix-r71-diag-coroutine-closure

Conversation

@SebTardif

Copy link
Copy Markdown
Owner

Summary

  • describe_field_from_ty: include CoroutineClosure with Closure/Coroutine so borrow diagnostics name async-closure captures instead of numeric field indices
  • add_moved_or_invoked_closure_note: treat CoroutineClosure like Closure for invoked-twice / moved-twice notes

Closes #478

Origin

CoroutineClosure was added in rust-lang@c567edd

describe_field_from_ty only matched Closure | Coroutine since rust-lang@fcb42b4 (and earlier Generator/Coroutine renames), without a follow-up arm for async closures.

Test plan

… notes

Async closures share closure_captures and closure_kind_origin with normal
closures. Include CoroutineClosure so borrow diagnostics name captures and
moved/invoked-twice notes fire for async closures.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

describe_field_from_ty missing CoroutineClosure, borrow errors show field index instead of capture name

1 participant