rust/src/test/ui/generator
bors 5ed3453af9 Auto merge of #69716 - jonas-schievink:generator-size, r=tmandry
Don't store locals in generators that are immediately overwritten with the resume argument

This fixes https://github.com/rust-lang/rust/issues/69672 and makes https://github.com/rust-lang/rust/pull/69033 pass the async fn size tests again (in other words, there will be no size regression of async fn if both this and https://github.com/rust-lang/rust/pull/69033 land).

~~This is a small botch and I'd rather have a more precise analysis, but that seems much harder to pull off, so this special-cases `Yield` terminators that store the resume argument into a simple local (ie. without any field projections) and explicitly marks that local as "not live" in the suspend point of that yield. We know that this local does not need to be stored in the generator for this suspend point because the next resume would immediately overwrite it with the passed-in resume argument anyways. The local might still end up in the state if it is used across another yield.~~ (this now properly updates the dataflow framework to handle this case)
2020-03-14 02:04:49 +00:00
..
auxiliary Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00
addassign-yield.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
async-generator-issue-67158.rs Do not ICE when encountering yield inside async block 2020-02-16 18:53:52 -08:00
async-generator-issue-67158.stderr Do not ICE when encountering yield inside async block 2020-02-16 18:53:52 -08:00
auto-trait-regions.nll.stderr Address review comments + Update NLL tests 2020-01-09 21:49:32 +03:00
auto-trait-regions.rs Update tests 2020-01-09 21:23:12 +03:00
auto-trait-regions.stderr Update tests 2020-01-09 21:23:12 +03:00
borrow-in-tail-expr.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
borrowing.rs Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00
borrowing.stderr Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00
conditional-drop.rs Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00
control-flow.rs Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00
drop-and-replace.rs Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00
drop-env.rs Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00
dropck-resume.rs Teach dropck about resume arguments 2020-02-02 13:20:58 +01:00
dropck-resume.stderr Teach dropck about resume arguments 2020-02-02 13:20:58 +01:00
dropck.rs Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00
dropck.stderr update tests for migrate mode by default 2019-04-22 08:40:08 +01:00
generator-region-requirements.migrate.stderr update tests for migrate mode by default 2019-04-22 08:40:08 +01:00
generator-region-requirements.rs Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00
generator-region-requirements.stderr Remove feature(nll) when compare mode is sufficient 2019-05-12 18:46:43 +01:00
generator-with-nll.rs Remove feature(nll) when compare mode is sufficient 2019-05-12 18:46:43 +01:00
generator-with-nll.stderr Remove feature(nll) when compare mode is sufficient 2019-05-12 18:46:43 +01:00
generator-yielding-or-returning-itself.rs Move stray generator test into the generator dir 2020-03-05 23:01:57 +01:00
generator-yielding-or-returning-itself.stderr Move stray generator test into the generator dir 2020-03-05 23:01:57 +01:00
issue-44197.rs Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00
issue-48048.rs Remove licenses 2018-12-25 21:08:33 -07:00
issue-48048.stderr Update tests 2019-03-11 23:10:26 +03:00
issue-52398.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
issue-53548-1.rs Use check-pass in ui tests where appropriate 2019-11-04 16:03:46 +01:00
issue-53548.rs Use check-pass in ui tests where appropriate 2019-11-04 16:03:46 +01:00
issue-57084.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
issue-58888.rs Upgrade Emscripten targets to use upstream LLVM backend 2019-10-16 17:06:48 -07:00
issue-61442-stmt-expr-with-drop.rs Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00
issue-62506-two_awaits.rs Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
issue-64620-yield-array-element.rs Add test for issue-64620 2020-03-09 09:12:41 +09:00
issue-64620-yield-array-element.stderr Add test for issue-64620 2020-03-09 09:12:41 +09:00
issue-69017.rs add main function to issue-69017 test 2020-02-10 13:47:52 -05:00
issue-69039.rs Move formatting to different function 2020-03-04 21:32:57 +01:00
iterator-count.rs Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00
live-upvar-across-yield.rs Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00
match-bindings.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
nested_generators.rs Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00
niche-in-generator.rs move test that shouldn't be in test/run-pass/ 2019-08-14 18:04:33 +02:00
non-static-is-unpin.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
not-send-sync.rs async/await: more improvements to non-send errors 2019-12-08 16:29:08 +00:00
not-send-sync.stderr Deduplicate generator interior types 2020-02-01 20:02:56 +01:00
overlap-locals.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
panic-drops-resume.rs Ignore panic-drops-resume.rs on wasm/emscripten 2020-02-06 15:00:36 +01:00
panic-drops.rs Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00
panic-safe.rs Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00
partial-initialization-across-yield.rs Fixed grammar/style in error messages and reblessed tests. 2019-09-06 03:46:08 +01:00
partial-initialization-across-yield.stderr Fixed grammar/style in error messages and reblessed tests. 2019-09-06 03:46:08 +01:00
pattern-borrow.rs Remove licenses 2018-12-25 21:08:33 -07:00
pattern-borrow.stderr Update tests 2019-03-11 23:10:26 +03:00
pin-box-generator.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
reborrow-mut-upvar.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
ref-escapes-but-not-over-yield.rs update tests for migrate mode by default 2019-04-22 08:40:08 +01:00
ref-escapes-but-not-over-yield.stderr Normalise diagnostics with respect to "the X is declared/defined here" 2020-01-24 16:24:49 +00:00
resume-after-return.rs Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00
resume-arg-late-bound.rs Add more tests for generator resume arguments 2020-02-04 13:18:29 +01:00
resume-arg-late-bound.stderr Add more tests for generator resume arguments 2020-02-04 13:18:29 +01:00
resume-arg-size.rs Add test for generator sizes with resume arguments 2020-03-06 01:45:45 +01:00
resume-live-across-yield.rs Fix miscompilation 2020-02-03 14:08:57 +01:00
retain-resume-ref.rs Add tests for generator resume arguments 2020-02-02 13:20:57 +01:00
retain-resume-ref.stderr Teach dropck about resume arguments 2020-02-02 13:20:58 +01:00
size-moved-locals.rs Upgrade Emscripten targets to use upstream LLVM backend 2019-10-16 17:06:48 -07:00
sized-yield.rs Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00
sized-yield.stderr Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00
smoke-resume-args.rs Add tests for generator resume arguments 2020-02-02 13:20:57 +01:00
smoke.rs Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00
static-generators.rs Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00
static-mut-reference-across-yield.rs Make pointers to statics internal 2020-01-23 21:38:15 +00:00
static-not-unpin.rs Account for Pin::new(_) and Pin::new(Box::new(_)) when Box::pin(_) would be applicable 2020-02-12 15:13:05 -08:00
static-not-unpin.stderr Account for Pin::new(_) and Pin::new(Box::new(_)) when Box::pin(_) would be applicable 2020-02-12 15:13:05 -08:00
static-reference-across-yield.rs Record temporary static references in generator witnesses 2019-11-26 23:18:41 +00:00
too-live-local-in-immovable-gen.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
too-many-parameters.rs Update error message with too many parameters 2020-02-04 13:35:38 +01:00
too-many-parameters.stderr Update error message with too many parameters 2020-02-04 13:35:38 +01:00
type-mismatch-error.rs Fix error message on type mismatch in generator 2020-02-02 13:20:57 +01:00
type-mismatch-error.stderr Fix error message on type mismatch in generator 2020-02-02 13:20:57 +01:00
type-mismatch-signature-deduction.rs Adjust tests to type inference changes 2020-02-02 13:20:57 +01:00
type-mismatch-signature-deduction.stderr Adjust tests to type inference changes 2020-02-02 13:20:57 +01:00
xcrate-reachable.rs Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00
xcrate.rs Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00
yield-in-args-rev.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
yield-in-args.rs Remove licenses 2018-12-25 21:08:33 -07:00
yield-in-args.stderr update tests for migrate mode by default 2019-04-22 08:40:08 +01:00
yield-in-box.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
yield-in-const.rs Yield is an expression form, not a statement. 2019-12-23 21:07:13 +08:00
yield-in-const.stderr Yield is an expression form, not a statement. 2019-12-23 21:07:13 +08:00
yield-in-function.rs Yield is an expression form, not a statement. 2019-12-23 21:07:13 +08:00
yield-in-function.stderr Yield is an expression form, not a statement. 2019-12-23 21:07:13 +08:00
yield-in-initializer.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
yield-in-static.rs Yield is an expression form, not a statement. 2019-12-23 21:07:13 +08:00
yield-in-static.stderr Yield is an expression form, not a statement. 2019-12-23 21:07:13 +08:00
yield-subtype.rs tests: Move run-pass tests without naming conflicts to ui 2019-07-27 18:56:16 +03:00
yield-while-iterating.rs Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00
yield-while-iterating.stderr Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00
yield-while-local-borrowed.rs Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00
yield-while-local-borrowed.stderr Update tests 2019-05-03 03:11:37 -04:00
yield-while-ref-reborrowed.rs Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00
yield-while-ref-reborrowed.stderr Add a resume type parameter to Generator 2020-02-02 13:20:57 +01:00