rust/tests/ui/coroutine
Matthias Krüger ad7aabd965
Rollup merge of #119563 - compiler-errors:coroutine-resume, r=oli-obk
Check yield terminator's resume type in borrowck

In borrowck, we didn't check that the lifetimes of the `TerminatorKind::Yield`'s `resume_place` were actually compatible with the coroutine's signature. That means that the lifetimes were totally going unchecked. Whoops!

This PR implements this checking.

Fixes #119564

r? types
2024-01-05 20:39:53 +01:00
..
auxiliary Fix coroutine validation for mixed panic strategy 2023-11-28 21:11:24 +01:00
print rename to verbose-internals 2023-12-19 13:35:37 -05:00
addassign-yield.rs
async-coroutine-issue-67158.rs
async-coroutine-issue-67158.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
async-gen-deduce-yield.rs Actually parse async gen blocks correctly 2023-12-12 20:13:37 +00:00
async-gen-yield-ty-is-unit.rs Ensure yield expressions desugar correctly in async generators 2023-12-18 01:42:19 +00:00
async_gen_fn.e2024.stderr Add tests 2023-12-08 17:23:26 +00:00
async_gen_fn.none.stderr Add tests 2023-12-08 17:23:26 +00:00
async_gen_fn.rs Add tests 2023-12-08 17:23:26 +00:00
async_gen_fn_iter.rs Use the Waker::noop API in tests 2023-12-14 18:34:29 +00:00
auto-trait-regions.rs
auto-trait-regions.stderr
borrow-in-tail-expr.rs
borrowing.rs
borrowing.stderr dropck_outlives check generator witness needs_drop 2023-11-02 17:20:13 +01:00
check-resume-ty-lifetimes-2.rs Check yield terminator's resume type in borrowck 2024-01-04 01:47:56 +00:00
check-resume-ty-lifetimes-2.stderr Check yield terminator's resume type in borrowck 2024-01-04 01:47:56 +00:00
check-resume-ty-lifetimes.rs Check yield terminator's resume type in borrowck 2024-01-04 01:47:56 +00:00
check-resume-ty-lifetimes.stderr Check yield terminator's resume type in borrowck 2024-01-04 01:47:56 +00:00
clone-impl-async.rs
clone-impl-async.stderr
clone-impl-static.rs
clone-impl-static.stderr
clone-impl.rs
clone-impl.stderr
clone-rpit.rs update use of feature flags 2023-12-14 15:22:37 +01:00
conditional-drop.rs
control-flow.rs remove redundant imports 2023-12-10 10:56:22 +08:00
coroutine-region-requirements.migrate.stderr Manual find replace updates 2023-11-24 21:04:51 +01:00
coroutine-region-requirements.rs
coroutine-region-requirements.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
coroutine-resume-after-panic.rs
coroutine-with-nll.rs
coroutine-with-nll.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
coroutine-yielding-or-returning-itself.rs
coroutine-yielding-or-returning-itself.stderr
derived-drop-parent-expr.rs
discriminant.rs remove redundant imports 2023-12-10 10:56:22 +08:00
drop-and-replace.rs
drop-control-flow.rs
drop-env.rs
drop-track-addassign-yield.rs
drop-tracking-parent-expression.rs
drop-tracking-parent-expression.stderr
drop-tracking-yielding-in-match-guards.rs
drop-yield-twice.rs
drop-yield-twice.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
dropck-resume.rs
dropck-resume.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
dropck.rs
dropck.stderr
gen_block.e2024.stderr Compute yield and return types outside of check_fn 2023-12-29 19:59:58 +00:00
gen_block.none.stderr Feature gate coroutine yield usage 2023-10-27 13:05:48 +00:00
gen_block.rs Feature gate coroutine yield usage 2023-10-27 13:05:48 +00:00
gen_block_is_coro.rs Feature gate gen blocks, even in 2024 edition 2023-10-27 13:05:48 +00:00
gen_block_is_coro.stderr Make gen blocks implement the Iterator trait 2023-10-27 13:05:48 +00:00
gen_block_is_iter.rs update use of feature flags 2023-12-14 15:22:37 +01:00
gen_block_is_no_future.rs Feature gate gen blocks, even in 2024 edition 2023-10-27 13:05:48 +00:00
gen_block_is_no_future.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
gen_block_iterate.rs update use of feature flags 2023-12-14 15:22:37 +01:00
gen_block_move.fixed Handle move generators 2023-10-27 13:05:48 +00:00
gen_block_move.rs Handle move generators 2023-10-27 13:05:48 +00:00
gen_block_move.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
gen_block_panic.rs Only run panic tests on targets that can unwind 2023-10-30 16:32:53 +00:00
gen_block_panic.stderr Only run panic tests on targets that can unwind 2023-10-30 16:32:53 +00:00
gen_fn.e2024.stderr gate gen fn behind gen_blocks 2023-12-04 11:23:06 -08:00
gen_fn.none.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
gen_fn.rs gate gen fn behind gen_blocks 2023-12-04 11:23:06 -08:00
gen_fn_iter.rs Merge Async and Gen into CoroutineKind 2023-12-04 12:48:01 -08:00
gen_fn_lifetime_capture.rs Address code review feedback 2023-12-04 14:33:46 -08:00
issue-44197.rs
issue-45729-unsafe-in-coroutine.rs Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
issue-45729-unsafe-in-coroutine.stderr Stabilize THIR unsafeck 2024-01-05 10:00:59 +00:00
issue-48048.rs
issue-48048.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-52304.rs
issue-52398.rs
issue-52398.stderr
issue-53548-1.rs
issue-53548.rs
issue-57017.rs
issue-57084.rs rename ReLateBound to ReBound 2023-11-13 14:13:54 +00:00
issue-57084.stderr
issue-57478.rs
issue-58888.rs Remove asmjs from tests 2023-10-28 23:11:03 -07:00
issue-61442-stmt-expr-with-drop.rs
issue-62506-two_awaits.rs
issue-64620-yield-array-element.rs
issue-64620-yield-array-element.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-68112.rs
issue-68112.stderr
issue-69017.rs
issue-69039.rs
issue-87142.rs
issue-88653.rs
issue-88653.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-91477.rs
issue-91477.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-93161.rs
issue-102645.rs
issue-102645.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-105084.rs
issue-105084.stderr
issue-110929-coroutine-conflict-error-ice.rs dropck_outlives check generator witness needs_drop 2023-11-02 17:20:13 +01:00
issue-113279.rs
issue-113279.stderr
iterator-count.rs remove redundant imports 2023-12-10 10:56:22 +08:00
layout-error.rs
layout-error.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
live-upvar-across-yield.rs
match-bindings.rs
match-bindings.stderr
metadata-sufficient-for-layout.rs
metadata-sufficient-for-layout.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
nested_coroutine.rs
niche-in-coroutine.rs
non-static-is-unpin.rs update use of feature flags 2023-12-14 15:22:37 +01:00
not-send-sync.rs
not-send-sync.stderr
overlap-locals.rs
panic-drops-resume.rs
panic-drops.rs
panic-safe.rs
parent-expression.rs
parent-expression.stderr
partial-drop.rs
partial-initialization-across-yield.rs
partial-initialization-across-yield.stderr
pattern-borrow.rs
pattern-borrow.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
pin-box-coroutine.rs
reborrow-mut-upvar.rs
reborrow-mut-upvar.stderr
ref-escapes-but-not-over-yield.rs
ref-escapes-but-not-over-yield.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
ref-upvar-not-send.rs
ref-upvar-not-send.stderr
reinit-in-match-guard.rs
resume-after-return.rs
resume-arg-late-bound.rs
resume-arg-late-bound.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
resume-arg-size.rs
resume-live-across-yield.rs
retain-resume-ref.rs
retain-resume-ref.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
return-types-diverge.rs Add a test demonstrating that RFC's note on diverging returns is subsumed by just inferring unit as ret type 2023-12-18 23:56:44 +00:00
return-types.rs Make sure all kinds of generators only return unit 2023-12-18 01:45:42 +00:00
return-types.stderr Make sure all kinds of generators only return unit 2023-12-18 01:45:42 +00:00
self_referential_gen_block.rs Use targetted diagnostic for borrow across yield error 2023-10-27 13:05:49 +00:00
self_referential_gen_block.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
size-moved-locals.rs Adjust compiler tests for unused_tuple_struct_fields -> dead_code 2024-01-02 15:34:37 -05:00
sized-yield.rs
sized-yield.stderr Compute yield and return types outside of check_fn 2023-12-29 19:59:58 +00:00
smoke-resume-args.rs remove redundant imports 2023-12-10 10:56:22 +08:00
smoke.rs
static-coroutine.rs
static-mut-reference-across-yield.rs Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
static-not-unpin.current.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
static-not-unpin.next.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
static-not-unpin.rs update use of feature flags 2023-12-14 15:22:37 +01:00
static-reference-across-yield.rs
too-live-local-in-immovable-gen.rs
too-live-local-in-immovable-gen.stderr
too-many-parameters.rs
too-many-parameters.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
type-mismatch-error.rs
type-mismatch-error.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
type-mismatch-signature-deduction.rs
type-mismatch-signature-deduction.stderr
uninhabited-field.rs Coroutine variant fields can be uninitialized 2023-12-12 00:00:00 +00:00
unresolved-ct-var.rs
unresolved-ct-var.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
unsized-capture-across-yield.rs
unsized-capture-across-yield.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
unsized-local-across-yield.rs
unsized-local-across-yield.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
unwind-abort-mix.rs Fix coroutine validation for mixed panic strategy 2023-11-28 21:11:24 +01:00
witness-ignore-fake-reads.rs generator layout: ignore fake borrows 2023-11-08 22:55:28 +01:00
xcrate-reachable.rs
xcrate.rs
yield-in-args-rev.rs
yield-in-args-rev.stderr
yield-in-args.rs
yield-in-args.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
yield-in-const.rs
yield-in-const.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
yield-in-function.rs
yield-in-function.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
yield-in-initializer.rs
yield-in-initializer.stderr
yield-in-static.rs
yield-in-static.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
yield-outside-coroutine-issue-78653.rs
yield-outside-coroutine-issue-78653.stderr
yield-subtype.rs
yield-subtype.stderr
yield-while-iterating.rs
yield-while-iterating.stderr
yield-while-local-borrowed.rs
yield-while-local-borrowed.stderr
yield-while-ref-reborrowed.rs
yield-while-ref-reborrowed.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
yielding-in-match-guards.rs