diff --git a/src/test/ui/async-await/proper-span-for-type-error.fixed b/src/test/ui/async-await/proper-span-for-type-error.fixed index 1f1e1184dcc..7d43b575d2f 100644 --- a/src/test/ui/async-await/proper-span-for-type-error.fixed +++ b/src/test/ui/async-await/proper-span-for-type-error.fixed @@ -5,7 +5,8 @@ async fn a() {} async fn foo() -> Result<(), i32> { - Ok(a().await) //~ ERROR mismatched types + a().await; + Ok(()) //~ ERROR mismatched types } fn main() {} diff --git a/src/test/ui/async-await/proper-span-for-type-error.stderr b/src/test/ui/async-await/proper-span-for-type-error.stderr index 611dc0407bf..25f05156ce2 100644 --- a/src/test/ui/async-await/proper-span-for-type-error.stderr +++ b/src/test/ui/async-await/proper-span-for-type-error.stderr @@ -6,10 +6,11 @@ LL | a().await | = note: expected enum `Result<(), i32>` found unit type `()` -help: try wrapping the expression in `Ok` +help: try adding an expression at the end of the block + | +LL ~ a().await; +LL ~ Ok(()) | -LL | Ok(a().await) - | +++ + error: aborting due to previous error