rust/src/test/ui/async-await
Aaron Hill 462f06de07
Emit coercion suggestions in more places
Fixes #66910

We have several different kinds of suggestions we can try to make when
type coercion fails. However, we were previously only emitting these
suggestions from `demand_coerce_diag`. This resulted in the compiler
failing to emit applicable suggestions in several different cases, such
as when the implicit return value of a function had the wrong type.

This commit adds a new `emit_coerce_suggestions` method, which tries to
emit a number of related suggestions. This method is called from both
`demand_coerce_diag` and `CoerceMany::coerce_inner`, which covers a much
wider range of cases than before.

We now suggest using `.await` in more cases where it is applicable,
among other improvements.
2019-12-03 21:51:16 -05:00
..
auxiliary Add extra arc_wake 2019-05-25 00:23:15 +01:00
await-keyword Remove "here" from "expected one of X here" 2019-11-06 17:26:20 -08:00
drop-order apply nits from centril 2019-09-17 04:53:28 -04:00
issues Rollup merge of #66679 - mark-i-m:fix-anon-lifetime-errors, r=matthewjasper 2019-12-01 04:49:23 +01:00
multiple-lifetimes Auto merge of #58281 - mark-i-m:synthesis, r=estebank 2019-11-18 22:08:31 +00:00
argument-patterns.rs Update test stderr with results of enabling unused lints 2019-09-08 11:32:28 -04:00
async-assoc-fn-anon-lifetimes.rs Ensure that associated async fns have unique fresh param names 2019-10-05 22:24:55 +01:00
async-await.rs Update test stderr with results of enabling unused lints 2019-09-08 11:32:28 -04:00
async-block-control-flow-static-semantics.rs WIP fix tests 2019-10-02 14:17:38 -04:00
async-block-control-flow-static-semantics.stderr Surround types with backticks in type errors 2019-11-18 11:03:04 -08:00
async-borrowck-escaping-block-error.fixed suggest to add move keyword for generator 2019-10-08 11:13:48 +00:00
async-borrowck-escaping-block-error.rs suggest to add move keyword for generator 2019-10-08 11:13:48 +00:00
async-borrowck-escaping-block-error.stderr query generator kind for error reporting 2019-10-10 17:27:23 +00:00
async-borrowck-escaping-closure-error.rs Fix suggestion from move async to async move. 2019-08-19 17:14:38 +01:00
async-borrowck-escaping-closure-error.stderr Fix suggestion from move async to async move. 2019-08-19 17:14:38 +01:00
async-closure-matches-expr.rs Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
async-closure.rs Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
async-error-span.rs s/async fn/async fn/ 2019-10-02 14:39:44 -04:00
async-error-span.stderr s/async fn/async fn/ 2019-10-02 14:39:44 -04:00
async-fn-elided-impl-lifetime-parameter.rs Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
async-fn-nonsend.rs Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
async-fn-nonsend.stderr rustc_typeck: don't record direct callees in generator_interior. 2019-10-24 01:58:25 +03:00
async-fn-path-elision.rs Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
async-fn-path-elision.stderr --bless post no async_await gates in tests. 2019-08-20 03:08:42 +02:00
async-fn-send-uses-nonsend.rs Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
async-fn-size-moved-locals.rs Upgrade Emscripten targets to use upstream LLVM backend 2019-10-16 17:06:48 -07:00
async-fn-size-uninit-locals.rs Upgrade Emscripten targets to use upstream LLVM backend 2019-10-16 17:06:48 -07:00
async-fn-size.rs Do not mark unitinitialized locals as requiring storage 2019-10-02 20:55:38 +01:00
async-matches-expr.rs Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
async-trait-fn.rs Reword help and add test 2019-11-18 12:30:21 -08:00
async-trait-fn.stderr Add error code documentation 2019-11-18 15:23:05 -08:00
async-unsafe-fn-call-in-safe.rs Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
async-unsafe-fn-call-in-safe.stderr --bless post no async_await gates in tests. 2019-08-20 03:08:42 +02:00
async-with-closure.rs Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
await-unsize.rs Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
bound-normalization.rs Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
conditional-and-guaranteed-initialization.rs Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
dont-print-desugared-async.rs Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
dont-print-desugared-async.stderr --bless post no async_await gates in tests. 2019-08-20 03:08:42 +02:00
dont-suggest-missing-await.rs Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
dont-suggest-missing-await.stderr Surround types with backticks in type errors 2019-11-18 11:03:04 -08:00
edition-deny-async-fns-2015.rs Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
edition-deny-async-fns-2015.stderr Add error code documentation 2019-11-18 15:23:05 -08:00
feature-async-closure.rs Adjust tests wrt. 'async_closure' feature gate. 2019-07-03 23:59:36 +02:00
feature-async-closure.stderr normalize use of backticks in compiler messages for libsyntax/feature_gate 2019-07-09 14:13:28 +02:00
futures-api.rs Remove duplicated arc_wake.rs 2019-07-06 14:09:41 +08:00
generics-and-bounds.rs Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
issue-60709.rs Upgrade Emscripten targets to use upstream LLVM backend 2019-10-16 17:06:48 -07:00
issue-61452.rs Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
issue-61452.stderr --bless post no async_await gates in tests. 2019-08-20 03:08:42 +02:00
issue-61793.rs Use build-pass in ui tests where appropriate 2019-11-04 16:03:46 +01:00
issue-61949-self-return-type.rs Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
issue-61949-self-return-type.stderr --bless post no async_await gates in tests. 2019-08-20 03:08:42 +02:00
issue-62658.rs Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
issue-63832-await-short-temporary-lifetime-1.rs lowering: extend temporary lifetimes around await 2019-09-10 11:27:57 +01:00
issue-63832-await-short-temporary-lifetime.rs lowering: extend temporary lifetimes around await 2019-09-10 11:27:57 +01:00
issue-64130-non-send-future-diags.rs async/await: improve obligation errors 2019-09-30 23:41:20 +01:00
issue-64130-non-send-future-diags.stderr async/await: improve obligation errors 2019-09-30 23:41:20 +01:00
issue-64391.rs add regression test for issue-64391 2019-09-16 16:44:18 -04:00
issue-66387-if-without-else.rs review comments 2019-11-14 11:08:56 -08:00
issue-66387-if-without-else.stderr fix rebase 2019-11-18 15:23:45 -08:00
move-part-await-return-rest-struct.rs Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
move-part-await-return-rest-tuple.rs Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
mutually-recursive-async-impl-trait-type.rs Check impl trait substs when checking for recursive types 2019-08-31 15:44:09 +01:00
mutually-recursive-async-impl-trait-type.stderr Check impl trait substs when checking for recursive types 2019-08-31 15:44:09 +01:00
nested-in-impl.rs Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
no-async-const.rs Tweak unexpected token wording 2019-10-28 10:53:13 -07:00
no-async-const.stderr Remove "here" from "expected one of X here" 2019-11-06 17:26:20 -08:00
no-const-async.rs Upgrade async/await to "used" keywords. 2019-09-28 09:15:06 -07:00
no-const-async.stderr Rework raw ident suggestions 2019-11-23 17:06:34 -08:00
no-move-across-await-struct.rs Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
no-move-across-await-struct.stderr --bless post no async_await gates in tests. 2019-08-20 03:08:42 +02:00
no-move-across-await-tuple.rs Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
no-move-across-await-tuple.stderr --bless post no async_await gates in tests. 2019-08-20 03:08:42 +02:00
no-non-guaranteed-initialization.rs Fixed grammar/style in error messages and reblessed tests. 2019-09-06 03:46:08 +01:00
no-non-guaranteed-initialization.stderr Fixed grammar/style in error messages and reblessed tests. 2019-09-06 03:46:08 +01:00
no-params-non-move-async-closure.rs Changing error messages and renaming tests #63127 2019-08-27 17:31:57 +02:00
no-params-non-move-async-closure.stderr Changing error messages and renaming tests #63127 2019-08-27 17:31:57 +02:00
no-unsafe-async.rs Tweak unexpected token wording 2019-10-28 10:53:13 -07:00
no-unsafe-async.stderr Remove "here" from "expected one of X here" 2019-11-06 17:26:20 -08:00
partial-initialization-across-await.rs Fixed grammar/style in error messages and reblessed tests. 2019-09-06 03:46:08 +01:00
partial-initialization-across-await.stderr Fixed grammar/style in error messages and reblessed tests. 2019-09-06 03:46:08 +01:00
recursive-async-impl-trait-type.rs Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
recursive-async-impl-trait-type.stderr Slightly clean up the error for recursive async fn 2019-08-31 15:43:24 +01:00
return-ty-raw-ptr-coercion.rs correct coercion comments 2019-10-02 14:23:36 -04:00
return-ty-unsize-coercion.rs fix example (le sigh) 2019-10-02 18:45:44 -04:00
suggest-missing-await-closure.fixed --bless post no async_await gates in tests. 2019-08-20 03:08:42 +02:00
suggest-missing-await-closure.rs Remove async_await gates from tests. 2019-08-20 03:08:42 +02:00
suggest-missing-await-closure.stderr Surround types with backticks in type errors 2019-11-18 11:03:04 -08:00
suggest-missing-await.fixed Emit coercion suggestions in more places 2019-12-03 21:51:16 -05:00
suggest-missing-await.rs Emit coercion suggestions in more places 2019-12-03 21:51:16 -05:00
suggest-missing-await.stderr Emit coercion suggestions in more places 2019-12-03 21:51:16 -05:00
suggest-switching-edition-on-await.rs typeck: add tests for suggesting -> 2018 on wrong <expr>.await 2019-08-14 01:52:16 +02:00
suggest-switching-edition-on-await.stderr typeck: add tests for suggesting -> 2018 on wrong <expr>.await 2019-08-14 01:52:16 +02:00
try-on-option-in-async.rs Make ItemContext available for better diagnositcs. 2019-10-30 06:12:49 +00:00
try-on-option-in-async.stderr added enclosing_scope attr to Try trait and fixed ui tests accordingly 2019-11-25 18:10:14 +03:00
unreachable-lint-1.rs typeck: silence unreachable code from await 2019-09-30 21:27:18 +01:00
unreachable-lint-1.stderr typeck: silence unreachable code from await 2019-09-30 21:27:18 +01:00
unreachable-lint.rs typeck: silence unreachable code from await 2019-09-30 21:27:18 +01:00
unresolved_type_param.rs s/async fn/async fn/ 2019-10-02 14:39:44 -04:00
unresolved_type_param.stderr s/async fn/async fn/ 2019-10-02 14:39:44 -04:00
unused-lifetime.rs Avoid unused lifetime warning for lifetimes introduced when desugering async. 2019-10-15 18:05:13 +01:00
unused-lifetime.stderr Avoid unused lifetime warning for lifetimes introduced when desugering async. 2019-10-15 18:05:13 +01:00