about summary refs log tree commit diff
path: root/tests/ui/generator
AgeCommit message (Collapse)AuthorLines
2023-10-20Rename `generator` folderOli Scherer-5490/+0
2023-10-20Rename lots of files that had `generator` in their nameOli Scherer-34/+34
2023-10-20Rename `Gen` to `Coro` in testsOli Scherer-5/+5
2023-10-20s/generator/coroutine/Oli Scherer-393/+393
2023-10-20s/Generator/Coroutine/Oli Scherer-188/+188
2023-09-23Bless tests.Camille GILLOT-460/+217
2023-09-23Revert duplication of tests.Camille GILLOT-2307/+257
2023-09-23Check types live across yields in generators tooMichael Goulet-0/+66
2023-09-21adjust how closure/generator types and rvalues are printedRalf Jung-96/+96
2023-08-28Rollup merge of #115311 - dtolnay:usearcself, r=compiler-errorsMatthias Krüger-62/+4
Revert "Suggest using `Arc` on `!Send`/`!Sync` types" Closes https://github.com/rust-lang/rust/issues/114687. This is a clean revert of https://github.com/rust-lang/rust/pull/88936 + https://github.com/rust-lang/rust/pull/115210. The suggestion to Arc\<{Self}\> when Self does not implement Send is *always* wrong. https://github.com/rust-lang/rust/pull/114842 is considering a way to make a more refined suggestion.
2023-08-28Revert "Suggest using `Arc` on `!Send`/`!Sync` types"David Tolnay-62/+4
This reverts commit 9de1a472b68ed85f396b2e2cc79c3ef17584d6e1.
2023-08-27More precisely detect cycle errors from type_of on opaqueMichael Goulet-20/+1
2023-08-09Suggest using `Arc` on `!Send`/`!Sync` typesEsteban Kuber-4/+62
2023-07-28Auto merge of #113312 - Ddystopia:auto-trait-fun, r=lcnrbors-3/+3
discard default auto trait impls if explicit ones exist (rebase of #85048) Rebase of #85048
2023-07-25abi: unsized field in union - assert to delay bugDavid Wood-0/+43
Unions cannot have unsized fields, and as such, layout computation for unions asserts that each union field is sized (as this would normally have halted compilation earlier). However, if a generator ends up with an unsized local - a circumstance in which an error will always have been emitted earlier, for example, if attempting to dereference a `&str` - then the generator transform will produce a union with an unsized field. Since #110107, later passes will be run, such as constant propagation, and can attempt layout computation on the generator, which will result in layout computation of `str` in the context of it being a field of a union - and so the aforementioned assertion would cause an ICE. It didn't seem appropriate to try and detect this case in the MIR body and skip this specific pass; tainting the MIR body or delaying a bug from the generator transform (or elsewhere) wouldn't prevent this either (as neither would prevent the later pass from running); and tainting when the deref of `&str` is reported, if that's possible, would unnecessarily prevent potential other errors from being reported later in compilation, and is very tailored to this specific case of getting a unsized type in a generator. Given that this circumstance can only happen when an error should have already been reported, the correct fix appears to be just changing the assert to a delayed bug. This will still assert if there is some circumstance where this occurs and no error has been reported, but it won't crash the compiler in this instance. Signed-off-by: David Wood <david@davidtw.co>
2023-07-10Do not set up wrong span for adjustmentsMichael Goulet-2/+2
2023-07-06update auto trait handlinglcnr-3/+3
2023-07-05Add some extra information to opaque type cycle errorsOli Scherer-1/+20
2023-05-21Rename `drop_ref` lint to `dropping_references`Urgau-1/+1
2023-05-21Rename `drop_copy` lint to `dropping_copy_types`Urgau-4/+4
2023-05-13Handle error body when in generator layoutclubby789-0/+35
2023-05-10Adjust tests for new drop and forget lintsUrgau-21/+25
2023-05-01Rollup merge of #110823 - compiler-errors:tweak-await-span, r=b-naberMatthias Krüger-72/+28
Tweak await span to not contain dot Fixes a discrepancy between method calls and await expressions where the latter are desugared to have a span that *contains* the dot (i.e. `.await`) but method call identifiers don't contain the dot. This leads to weird suggestions suggestions in borrowck -- see linked issue. Fixes #110761 This mostly touches a bunch of tests to tighten their `await` span.
2023-04-28Fix an ICE in conflict errors diagnosticsMaybe Waffle-314/+17
2023-04-28Add regression test for issue 110929Maybe Waffle-0/+327
2023-04-27Tweak await spanMichael Goulet-28/+28
2023-04-27Remove a bunch of orphaned test filesMichael Goulet-44/+0
2023-04-25vars are ?Michael Goulet-1/+1
2023-04-19Extend and use `hir::Node::body_id`Maybe Waffle-53/+30
2023-04-14Assemble Unpin candidates specially for generators in new solverMichael Goulet-4/+28
2023-04-13Rollup merge of #110259 - ndrewxie:issue-109964-fix-gitstuff, r=cjgillotMatthias Krüger-1/+2
Added diagnostic for pin! macro in addition to Box::pin if Unpin isn't implemented I made a PR earlier, but accidentally renamed a branch and that deleted the PR... sorry for the duplicate Currently, if an operation on `Pin<T>` is performed that requires `T` to implement `Unpin`, the diagnostic suggestion is to use `Box::pin` ("note: consider using `Box::pin`"). This PR suggests pin! as well, as that's another valid way of pinning a value, and avoids a heap allocation. Appropriate diagnostic suggestions were included to highlight the difference in semantics (local pinning for pin! vs non-local for Box::pin). Fixes #109964
2023-04-12Tweak output for 'add line' suggestionEsteban Küber-2/+4
2023-04-12Added diagnostic for pin! macro in addition to Box::pin if Unpin isn't ↵Andrew Xie-1/+2
implemented
2023-04-12Split out a separate feature gate for impl trait in associated typesOli Scherer-1/+1
2023-04-05Bless testsThom Chiovoloni-12/+12
2023-03-12Remove uses of `box_syntax` in rustc and toolsclubby789-51/+11
2023-02-22diagnostics: update test cases to refer to assoc fn with `self` as methodMichael Howell-1/+1
2023-02-21Specify what 'this' actually isMichael Goulet-2/+2
2023-01-30Modify primary span label for E0308Esteban Küber-2/+2
The previous output was unintuitive to users.
2023-01-27Restrict amount of ignored locals.Camille GILLOT-0/+100
2023-01-27Bless tests.Camille GILLOT-1299/+317
2023-01-27Always require Drop for generators.Camille GILLOT-9/+18
2023-01-27Test the 3 generator handling versions for generator/async tests.Camille GILLOT-71/+3268
2023-01-25Rollup merge of #106944 - Nilstrieb:there-once-was-a-diagnostic, r=WaffleLapkinMatthias Krüger-5/+15
Suggest using a lock for `*Cell: Sync` bounds I mostly did this for `OnceCell<T>` at first because users will be confused to see that the `OnceCell<T>` in `std` isn't `Sync` but then extended it to `Cell<T>` and `RefCell<T>` as well.
2023-01-19Add `rustc_on_unimplemented` on `Sync` for cell typesNilstrieb-5/+15
Suggest using a lock instead.
2023-01-17Account for method call and indexing when looking for inner-most path in ↵Esteban Küber-0/+3
expression
2023-01-11Change `src/test` to `tests` in source files, fix tidy and testsAlbert Larsan-2/+2
2023-01-11Move /src/test to /testsAlbert Larsan-0/+5348