summary refs log tree commit diff
path: root/tests/ui/coroutine
AgeCommit message (Collapse)AuthorLines
2024-01-30Provide more context on derived obligation error primary labelEsteban Küber-26/+26
Expand the primary span of E0277 when the immediate unmet bound is not what the user wrote: ``` error[E0277]: the trait bound `i32: Bar` is not satisfied --> f100.rs:6:6 | 6 | <i32 as Foo>::foo(); | ^^^ the trait `Bar` is not implemented for `i32`, which is required by `i32: Foo` | help: this trait has no implementations, consider adding one --> f100.rs:2:1 | 2 | trait Bar {} | ^^^^^^^^^ note: required for `i32` to implement `Foo` --> f100.rs:3:14 | 3 | impl<T: Bar> Foo for T {} | --- ^^^ ^ | | | unsatisfied trait bound introduced here ``` Fix #40120.
2024-01-24Deduplicate more sized errors on call exprsEsteban Küber-27/+52
Change the implicit `Sized` `Obligation` `Span` for call expressions to include the whole expression. This aids the existing deduplication machinery to reduce the number of errors caused by a single unsized expression.
2024-01-23Random type checker changesMichael Goulet-3/+3
2024-01-17Remove unnecessary `let`s and borrowing from `Waker::noop()` usage.Kevin Reid-4/+2
`Waker::noop()` now returns a `&'static Waker` reference, so it can be passed directly to `Context` creation with no temporary lifetime issue.
2024-01-13Bless testsGeorge-lewis-0/+5
Update tests
2024-01-11Remove special-casing around aliaskind in new solverMichael Goulet-1/+54
2024-01-05Rollup merge of #119563 - compiler-errors:coroutine-resume, r=oli-obkMatthias Krüger-0/+109
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-05Stabilize THIR unsafeckMatthew Jasper-1/+1
2024-01-05Remove revisions for THIR unsafeckMatthew Jasper-17/+1
This is to make the diff when stabilizing it easier to review.
2024-01-05Auto merge of #118297 - shepmaster:warn-dead-tuple-fields, r=WaffleLapkinbors-1/+1
Merge `unused_tuple_struct_fields` into `dead_code` This implicitly upgrades the lint from `allow` to `warn` and places it into the `unused` lint group. [Discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Moving.20.60unused_tuple_struct_fields.60.20from.20allow.20to.20warn)
2024-01-04Check yield terminator's resume type in borrowckMichael Goulet-0/+109
2024-01-02Adjust compiler tests for unused_tuple_struct_fields -> dead_codeJake Goulding-1/+1
2023-12-29Compute yield and return types outside of check_fnMichael Goulet-4/+4
2023-12-19rename to verbose-internalsjyn-3/+3
2023-12-18Add a test demonstrating that RFC's note on diverging returns is subsumed by ↵Michael Goulet-0/+20
just inferring unit as ret type
2023-12-18Make sure all kinds of generators only return unitMichael Goulet-0/+52
2023-12-18Ensure `yield` expressions desugar correctly in async generatorsMichael Goulet-0/+17
2023-12-14Rollup merge of #118948 - compiler-errors:noop, r=eholkJubilee-19/+5
Use the `Waker::noop` API in tests Avoids the need to duplicate this code over and over again r? eholk
2023-12-14Use the Waker::noop API in testsMichael Goulet-19/+5
2023-12-14update use of feature flagslcnr-5/+5
2023-12-13Rollup merge of #118871 - tmiasko:coroutine-maybe-uninit-fields, ↵Matthias Krüger-0/+37
r=compiler-errors Coroutine variant fields can be uninitialized Wrap coroutine variant fields in MaybeUninit to indicate that they might be uninitialized. Otherwise an uninhabited field will make the entire variant uninhabited and introduce undefined behaviour. The analogous issue in the prefix of coroutine layout was addressed by 6fae7f807146e400fa2bbd1c44768d9bcaa57c4c.
2023-12-12Actually parse async gen blocks correctlyMichael Goulet-0/+14
2023-12-12Coroutine variant fields can be uninitializedTomasz Miąsko-0/+37
Wrap coroutine variant fields in MaybeUninit to indicate that they might be uninitialized. Otherwise an uninhabited field will make the entire variant uninhabited and introduce undefined behaviour. The analogous issue in the prefix of coroutine layout was addressed by 6fae7f807146e400fa2bbd1c44768d9bcaa57c4c.
2023-12-10remove redundant importssurechen-5/+2
detects redundant imports that can be eliminated. for #117772 : In order to facilitate review and modification, split the checking code and removing redundant imports code into two PR.
2023-12-08Make async generators fused by defaultMichael Goulet-0/+4
2023-12-08Add testsMichael Goulet-10/+132
2023-12-08Support async gen fnMichael Goulet-13/+7
2023-12-04Address code review feedbackEric Holk-0/+19
2023-12-04Merge Async and Gen into CoroutineKindEric Holk-0/+2
2023-12-04Add a basic test for gen fnEric Holk-0/+18
2023-12-04Make async gen fn an errorEric Holk-0/+19
2023-12-04gate gen fn behind gen_blocksEric Holk-3/+5
2023-11-28Fix coroutine validation for mixed panic strategyTomasz Miąsko-0/+24
Validation introduced in #113124 allows UnwindAction::Continue and TerminatorKind::Resume to occur only in functions with ABI that can unwind. The function ABI depends on the panic strategy, which can vary across crates. Usually MIR is built and validated in the same crate. The coroutine drop glue thus far was an exception. As a result validation could fail when mixing different panic strategies. Avoid the problem by executing AbortUnwindingCalls along with the validation.
2023-11-24Manual find replace updatesNilstrieb-1/+1
2023-11-24Show number in error message even for one errorNilstrieb-36/+36
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-11-22Allow defining opaques in check_coroutine_obligationsMichael Goulet-0/+17
2023-11-17Rollup merge of #117338 - workingjubilee:asmjs-meets-thanatos, r=b-naberMatthias Krüger-2/+0
Remove asmjs Fulfills [MCP 668](https://github.com/rust-lang/compiler-team/issues/668). `asmjs-unknown-emscripten` does not work as-specified, and lacks essential upstream support for generating asm.js, so it should not exist at all.
2023-11-13rename `ReLateBound` to `ReBound`lcnr-1/+1
other changes: - `Region::new_late_bound` -> `Region::new_bound` - `Region::is_late_bound` -> `Region::is_bound`
2023-11-08generator layout: ignore fake borrowslcnr-0/+34
2023-11-02dropck_outlives check generator witness needs_droplcnr-37/+10
2023-10-30Only run panic tests on targets that can unwindOli Scherer-1/+2
2023-10-30Add a custom panic message for resuming `gen` blocks after they panickedOli Scherer-0/+37
2023-10-30Talk about `gen fn` in diagnostics about `gen fn`Oli Scherer-3/+3
2023-10-28Remove asmjs from testsJubilee Young-2/+0
2023-10-27Fuse `gen` blocksOli Scherer-19/+2
2023-10-27Use targetted diagnostic for borrow across yield errorOli Scherer-2/+2
2023-10-27Prevent generators from being movableOli Scherer-0/+28
2023-10-27Handle `move` generatorsOli Scherer-0/+98
2023-10-27Feature gate coroutine `yield` usageOli Scherer-5/+25
2023-10-27Demonstrate issue with `yield` checksOli Scherer-2/+15