diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-06-19 01:52:13 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-06-19 01:52:13 +0200 |
| commit | fde341a4ef6a5728dfd1acb5de0b238918a2dd44 (patch) | |
| tree | ab68af031220c4330a15f77663849e848c858a62 /src/test | |
| parent | 9b7b47cd57113fcef6842e249e2c3e9260f44380 (diff) | |
| parent | d67db0042c1f4e163292ea59bdfac546c67f7001 (diff) | |
| download | rust-fde341a4ef6a5728dfd1acb5de0b238918a2dd44.tar.gz rust-fde341a4ef6a5728dfd1acb5de0b238918a2dd44.zip | |
Rollup merge of #61941 - cramertj:no-more-yield-errors, r=centril
Preserve generator and yield source for error messages Previously, error messages after HIR lowering all referred to generators and yield, regardless of whether the original source was a generator or an async/await body. This change tracks the kind of each generator and yield source in order to provide appropriately tailored error messages. Fixes #60615.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/async-await/unresolved_type_param.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/async-await/unresolved_type_param.stderr | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/test/ui/async-await/unresolved_type_param.rs b/src/test/ui/async-await/unresolved_type_param.rs index 77174b03217..578d41fe0df 100644 --- a/src/test/ui/async-await/unresolved_type_param.rs +++ b/src/test/ui/async-await/unresolved_type_param.rs @@ -7,9 +7,9 @@ async fn bar<T>() -> () {} async fn foo() { bar().await; - //~^ ERROR type inside generator must be known in this context + //~^ ERROR type inside `async` object must be known in this context //~| NOTE cannot infer type for `T` - //~| NOTE the type is part of the generator because of this `yield` + //~| NOTE the type is part of the `async` object because of this `await` //~| NOTE in this expansion of desugaring of `await` } fn main() {} diff --git a/src/test/ui/async-await/unresolved_type_param.stderr b/src/test/ui/async-await/unresolved_type_param.stderr index afb9adf4c77..f3090a2b980 100644 --- a/src/test/ui/async-await/unresolved_type_param.stderr +++ b/src/test/ui/async-await/unresolved_type_param.stderr @@ -1,10 +1,10 @@ -error[E0698]: type inside generator must be known in this context +error[E0698]: type inside `async` object must be known in this context --> $DIR/unresolved_type_param.rs:9:5 | LL | bar().await; | ^^^ cannot infer type for `T` | -note: the type is part of the generator because of this `yield` +note: the type is part of the `async` object because of this `await` --> $DIR/unresolved_type_param.rs:9:5 | LL | bar().await; |
