about summary refs log tree commit diff
path: root/src/test/ui/async-await
AgeCommit message (Collapse)AuthorLines
2021-02-13spell the real selftypecsmoe-1/+1
2021-02-12spell out nested self typecsmoe-0/+11
2021-02-12add testcase for issue 78600csmoe-0/+12
2021-02-10Rollup merge of #81926 - henryboisdequin:fix-81907, r=estebankYuki Okushi-0/+3
add suggestion to use the `async_recursion` crate Closes #81907 CC `@estebank`
2021-02-09add suggestion to use the `async_recursion` crateHenry Boisdequin-0/+3
2021-02-06path trimming: ignore type aliasesDan Aloni-7/+7
2021-02-03Stabilize the Wake traitYoshua Wuyts-1/+0
Co-Authored-By: Ashley Mannix <kodraus@hey.com>
2021-02-02Rollup merge of #81634 - jesusprubio:jesusprubio/add-long-explanation-e0521, ↵Jack Huey-1/+2
r=GuillaumeGomez Add long explanation e0521 Helps with #61137
2021-02-02Update ui tests (nll)Jesus Rubio-1/+2
2021-01-31Move some tests to more reasonable directoriesCaio-0/+38
2021-01-17Auto merge of #80942 - c410-f3r:tests-tests-tests, r=petrochenkovbors-0/+83
Move some tests to more reasonable directories - 2 All tests with a score equal or greater than 1.0 were moved to their respective directories by issuing ```bash cat FILE | tr -s " " | tr -d '():' | sort -k3 | awk '$3 >= 1' | cut -d " " -f1-2 | sed 's;\\;/;g' | xargs -n2 git mv ``` **Observation**: The first column values is the only column with results greater zero To attest the confidentiality of the model, some manual revision of at least of tests is needed and this process will be tracked in the following list: * `src/test/ui/abi/issue-28676.rs` OK #28676 * `src/test/ui/array-slice-vec/issue-15730.rs` OK * `src/test/ui/associated-types/issue-24338.rs` OK #54823 * `src/test/ui/associated-types/issue-48551.rs` Looks OK #48551 * `src/test/ui/associated-types/issue-50301.rs` Looks OK #63577 ... cc #73494 r? `@petrochenkov`
2021-01-16Move some tests to more reasonable directories - 2Caio-0/+83
Address comments Update limits
2021-01-16Rollup merge of #80614 - 1000teslas:issue-78938-fix, r=tmandryMara Bos-0/+54
Explain why borrows can't be held across yield point in async blocks For https://github.com/rust-lang/rust/issues/78938.
2021-01-14Auto merge of #79689 - Vooblin:patch1, r=tmandrybors-54/+55
Update tests of "unused_lifetimes" lint for async functions and corresponding source code Before this PR the following code would cause an error: ``` #![deny(unused_lifetimes)] async fn f<'a>(_: &'a i32) {} fn main() {} ``` It was happening because of the desugaring of return type in async functions. As a result of the desugaring, the return type contains all lifetimes involved in the function signature. And these lifetimes were interpreted separately from the same in the function scope => so they are unused. Now, all lifetimes from the return type are interpreted as used. It is also not perfect, but at least this lint doesn't cause wrong errors now. This PR connected to issues #78522, #77217
2021-01-14Fix error E0373 documentation1000teslas-1/+1
2021-01-13Auto merge of #77524 - Patryk27:fixes/66228, r=estebankbors-4/+17
Rework diagnostics for wrong number of generic args (fixes #66228 and #71924) This PR reworks the `wrong number of {} arguments` message, so that it provides more details and contextual hints.
2021-01-14Bless test output1000teslas-1/+0
2021-01-12Update src/test/ui/async-await/issues/issue-78938-async-block.stderr1000teslas-1/+1
Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
2021-01-12Auto merge of #76580 - rokob:iss76011, r=estebankbors-0/+1
Suggest async {} for async || {} Fixes #76011 This adds support for adding help diagnostics to the feature gating checks and then uses it for the async_closure gate to add the extra bit of help information as described in the issue.
2021-01-10Rework diagnostics for wrong number of generic argsPatryk Wychowaniec-4/+17
2021-01-10Revise async block error message1000teslas-9/+1
2021-01-10Update issue-78938-async-block.rs1000teslas-1/+1
Fix whitespace
2021-01-10Fix location of error message explanation1000teslas-5/+5
2021-01-10Explain why borrows can't be held across yield point in async blocks1000teslas-0/+63
2020-12-31Consistently call editions "Rust 20xx" in messages.Mara Bos-18/+18
2020-12-31Add edition 2021.Mara Bos-13/+13
2020-12-26update testsBastian Kauschke-5/+4
2020-12-17Prefer regions with an `external_name` in `approx_universal_upper_bound`Aaron Hill-1/+29
Fixes #75785 When displaying a MIR borrowcheck error, we may need to find an upper bound for a region, which gives us a region to point to in the error message. However, a region might outlive multiple distinct universal regions, in which case the only upper bound is 'static To try to display a meaningful error message, we compute an 'approximate' upper bound by picking one of the universal regions. Currently, we pick the region with the lowest index - however, this caused us to produce a suboptimal error message in issue #75785 This PR `approx_universal_upper_bound` to prefer regions with an `external_name`. This causes us to prefer regions from function arguments/upvars, which seems to lead to a nicer error message in some cases.
2020-12-04Update tests of "unused_lifetimes" lint for async functions and ↵Dmitry Murygin-54/+55
corresponding source code
2020-12-01Fix UI tests for negative polarity implementations of traitsThePuzzlemaker-2/+0
2020-11-23Rename `optin_builtin_traits` to `auto_traits`Camelid-1/+1
They were originally called "opt-in, built-in traits" (OIBITs), but people realized that the name was too confusing and a mouthful, and so they were renamed to just "auto traits". The feature flag's name wasn't updated, though, so that's what this PR does. There are some other spots in the compiler that still refer to OIBITs, but I don't think changing those now is worth it since they are internal and not particularly relevant to this PR. Also see <https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/opt-in.2C.20built-in.20traits.20(auto.20traits).20feature.20name>.
2020-11-10Rollup merge of #76765 - guswynn:async_return, r=tmandryJonas Schievink-4/+7
Make it more clear what an about async fn's returns when referring to what it returns see #76547 This is *likely* not the ONLY place that this happens to be unclear, but we can move this fn to rustc_middle or something like that and reuse it if need be, to apply it to more diagnostics One outstanding question I have is, if the fn returns (), should I make the message more clear (what about `fn f()` vs `fn f() -> ()`, can you tell those apart in the hir?) R? `@tmandry` `@rustbot` modify labels +A-diagnostics +T-compiler
2020-11-09Rollup merge of #76468 - SNCPlay42:lifetime-names, r=Mark-SimulacrumDylan DPC-0/+118
Improve lifetime name annotations for closures & async functions * Don't refer to async functions as "generators" in error output * Where possible, emit annotations pointing exactly at the `&` in the return type of closures (when they have explicit return types) and async functions, like we do for arguments. Addresses #74072, but I wouldn't call that *closed* until annotations are identical for async and non-async functions. * Emit a better annotation when the lifetime doesn't appear in the full name type, which currently happens for opaque types like `impl Future`. Addresses #74497, but further improves could probably be made (why *doesn't* it appear in the type as `impl Future + '1`?) This is included in the same PR because the changes to `give_name_if_anonymous_region_appears_in_output` would introduce ICE otherwise (it would return `None` in cases where it didn't previously, which then gets `unwrap`ped)
2020-11-09use RegionNameHighlight for async fn and closure returnsSNCPlay42-2/+52
2020-11-04Fix issue 78654.Hameer Abbasi-0/+54
2020-11-02Only separate notes if span is multilineYuki Okushi-6/+3
2020-11-02Add "this has type `{}` which {}" noteYuki Okushi-0/+13
2020-11-02Address some code reviewsYuki Okushi-16/+4
2020-11-02Separate complex multispan into some notesYuki Okushi-25/+30
2020-11-02Avoid complex diagnostics in snippets which contain newlinesYuki Okushi-0/+56
2020-10-28Rollup merge of #78297 - estebank:match-semicolon-2, r=oli-obkDylan DPC-9/+49
Suggest calling await on method call and field access When encountering a failing method or field resolution on a `Future`, look at the `Output` and try the same operation on it. If successful, suggest calling `.await` on the `Future`. This had already been introduced in #72784, but at some point they stopped working. Built on top of #78214, only last commit is relevant. r? @oli-obk
2020-10-27Add unsized_fn_params featureSantiago Pastorino-1/+1
2020-10-26Suggest calling await on method call and field accessEsteban Küber-9/+49
When encountering a failing method or field resolution on a `Future`, look at the `Output` and try the same operation on it. If successful, suggest calling `.await` on the `Future`. This had already been introduced in #72784, but at some point they stopped working.
2020-10-23Add more `.await` suggestions on E0308Esteban Küber-37/+14
2020-10-23Silence unnecessary `await foo?` knock-down errorEsteban Küber-67/+33
2020-10-23Tweak "use `.await`" suggestionEsteban Küber-34/+39
2020-10-17Make it more clear when complaining about async fn's return typesGus Wynn-4/+7
2020-10-06Fix tests from rebaseMatthew Jasper-34/+2
2020-10-06Remove predicates on associated types from traitsMatthew Jasper-2/+2
These need to only be bounds to avoid cycle errors in trait checking.
2020-10-06Check opaque types satisfy their boundsMatthew Jasper-5/+0