about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-10-02 21:31:46 +0000
committerMichael Goulet <michael@errs.io>2023-10-03 02:25:32 +0000
commit2934fe07b7fd60760e0e9e7d509601b893d7b3fd (patch)
treeb88babc5a8361f65b76c865fae51d8b8c19b3ff2
parent2e5a9dd6c9eaa42f0684b4b760bd68fc27cbe51b (diff)
downloadrust-2934fe07b7fd60760e0e9e7d509601b893d7b3fd.tar.gz
rust-2934fe07b7fd60760e0e9e7d509601b893d7b3fd.zip
Point to full async fn for future
-rw-r--r--compiler/rustc_ast_lowering/src/lib.rs5
-rw-r--r--src/tools/clippy/tests/ui/crashes/ice-10645.stderr4
-rw-r--r--src/tools/clippy/tests/ui/future_not_send.stderr37
-rw-r--r--tests/ui/async-await/async-await-let-else.stderr2
-rw-r--r--tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.stderr4
-rw-r--r--tests/ui/async-await/in-trait/async-generics-and-bounds.stderr16
-rw-r--r--tests/ui/async-await/in-trait/async-generics.stderr16
-rw-r--r--tests/ui/async-await/in-trait/async-recursive-generic.stderr4
-rw-r--r--tests/ui/async-await/in-trait/async-recursive.stderr4
-rw-r--r--tests/ui/async-await/in-trait/dont-project-to-specializable-projection.stderr8
-rw-r--r--tests/ui/async-await/issue-64130-3-other.stderr2
-rw-r--r--tests/ui/async-await/issues/issue-67893.stderr4
-rw-r--r--tests/ui/async-await/mutually-recursive-async-impl-trait-type.stderr8
-rw-r--r--tests/ui/async-await/partial-drop-partial-reinit.stderr2
-rw-r--r--tests/ui/async-await/recursive-async-impl-trait-type.stderr4
-rw-r--r--tests/ui/suggestions/impl-trait-missing-lifetime.stderr6
-rw-r--r--tests/ui/suggestions/suggest-ret-on-async-w-late.stderr2
-rw-r--r--tests/ui/typeck/issue-90027-async-fn-return-suggestion.stderr4
18 files changed, 68 insertions, 64 deletions
diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs
index 85ab5e7223b..7e3ada9c123 100644
--- a/compiler/rustc_ast_lowering/src/lib.rs
+++ b/compiler/rustc_ast_lowering/src/lib.rs
@@ -1824,7 +1824,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
             }
 
             let fn_def_id = self.local_def_id(fn_node_id);
-            self.lower_async_fn_ret_ty(&decl.output, fn_def_id, ret_id, kind)
+            self.lower_async_fn_ret_ty(&decl.output, fn_def_id, ret_id, kind, fn_span)
         } else {
             match &decl.output {
                 FnRetTy::Ty(ty) => {
@@ -1901,8 +1901,9 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
         fn_def_id: LocalDefId,
         opaque_ty_node_id: NodeId,
         fn_kind: FnDeclKind,
+        fn_span: Span,
     ) -> hir::FnRetTy<'hir> {
-        let span = self.lower_span(output.span());
+        let span = self.lower_span(fn_span);
         let opaque_ty_span = self.mark_span_with_reason(DesugaringKind::Async, span, None);
 
         let captured_lifetimes: Vec<_> = self
diff --git a/src/tools/clippy/tests/ui/crashes/ice-10645.stderr b/src/tools/clippy/tests/ui/crashes/ice-10645.stderr
index fc5347c86cd..7fc62d4fcf8 100644
--- a/src/tools/clippy/tests/ui/crashes/ice-10645.stderr
+++ b/src/tools/clippy/tests/ui/crashes/ice-10645.stderr
@@ -1,8 +1,8 @@
 warning: future cannot be sent between threads safely
-  --> $DIR/ice-10645.rs:5:35
+  --> $DIR/ice-10645.rs:5:1
    |
 LL | pub async fn bar<'a, T: 'a>(_: T) {}
-   |                                   ^ future returned by `bar` is not `Send`
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `bar` is not `Send`
    |
 note: captured value is not `Send`
   --> $DIR/ice-10645.rs:5:29
diff --git a/src/tools/clippy/tests/ui/future_not_send.stderr b/src/tools/clippy/tests/ui/future_not_send.stderr
index f43e3c8ff9f..7ef4947f1d6 100644
--- a/src/tools/clippy/tests/ui/future_not_send.stderr
+++ b/src/tools/clippy/tests/ui/future_not_send.stderr
@@ -1,8 +1,8 @@
 error: future cannot be sent between threads safely
-  --> $DIR/future_not_send.rs:7:62
+  --> $DIR/future_not_send.rs:7:1
    |
 LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
-   |                                                              ^^^^ future returned by `private_future` is not `Send`
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `private_future` is not `Send`
    |
 note: future is not `Send` as this value is used across an await
   --> $DIR/future_not_send.rs:9:20
@@ -23,10 +23,10 @@ LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
    = help: to override `-D warnings` add `#[allow(clippy::future_not_send)]`
 
 error: future cannot be sent between threads safely
-  --> $DIR/future_not_send.rs:12:42
+  --> $DIR/future_not_send.rs:12:1
    |
 LL | pub async fn public_future(rc: Rc<[u8]>) {
-   |                                          ^ future returned by `public_future` is not `Send`
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future` is not `Send`
    |
 note: future is not `Send` as this value is used across an await
   --> $DIR/future_not_send.rs:14:20
@@ -39,10 +39,10 @@ LL |     async { true }.await;
    = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
 
 error: future cannot be sent between threads safely
-  --> $DIR/future_not_send.rs:21:63
+  --> $DIR/future_not_send.rs:21:1
    |
 LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
-   |                                                               ^^^^ future returned by `private_future2` is not `Send`
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `private_future2` is not `Send`
    |
 note: captured value is not `Send`
   --> $DIR/future_not_send.rs:21:26
@@ -58,10 +58,10 @@ LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
    = note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
 
 error: future cannot be sent between threads safely
-  --> $DIR/future_not_send.rs:26:43
+  --> $DIR/future_not_send.rs:26:1
    |
 LL | pub async fn public_future2(rc: Rc<[u8]>) {}
-   |                                           ^ future returned by `public_future2` is not `Send`
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future2` is not `Send`
    |
 note: captured value is not `Send`
   --> $DIR/future_not_send.rs:26:29
@@ -71,10 +71,10 @@ LL | pub async fn public_future2(rc: Rc<[u8]>) {}
    = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
 
 error: future cannot be sent between threads safely
-  --> $DIR/future_not_send.rs:38:39
+  --> $DIR/future_not_send.rs:38:5
    |
 LL |     async fn private_future(&self) -> usize {
-   |                                       ^^^^^ future returned by `private_future` is not `Send`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `private_future` is not `Send`
    |
 note: future is not `Send` as this value is used across an await
   --> $DIR/future_not_send.rs:40:24
@@ -87,10 +87,10 @@ LL |         async { true }.await;
    = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
 
 error: future cannot be sent between threads safely
-  --> $DIR/future_not_send.rs:44:39
+  --> $DIR/future_not_send.rs:44:5
    |
 LL |     pub async fn public_future(&self) {
-   |                                       ^ future returned by `public_future` is not `Send`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future` is not `Send`
    |
 note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
   --> $DIR/future_not_send.rs:44:32
@@ -100,10 +100,13 @@ LL |     pub async fn public_future(&self) {
    = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
 
 error: future cannot be sent between threads safely
-  --> $DIR/future_not_send.rs:55:37
+  --> $DIR/future_not_send.rs:55:1
    |
-LL | async fn generic_future<T>(t: T) -> T
-   |                                     ^ future returned by `generic_future` is not `Send`
+LL | / async fn generic_future<T>(t: T) -> T
+LL | |
+LL | | where
+LL | |     T: Send,
+   | |____________^ future returned by `generic_future` is not `Send`
    |
 note: future is not `Send` as this value is used across an await
   --> $DIR/future_not_send.rs:61:20
@@ -115,10 +118,10 @@ LL |     async { true }.await;
    = note: `T` doesn't implement `std::marker::Sync`
 
 error: future cannot be sent between threads safely
-  --> $DIR/future_not_send.rs:73:34
+  --> $DIR/future_not_send.rs:73:1
    |
 LL | async fn unclear_future<T>(t: T) {}
-   |                                  ^ future returned by `unclear_future` is not `Send`
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `unclear_future` is not `Send`
    |
 note: captured value is not `Send`
   --> $DIR/future_not_send.rs:73:28
diff --git a/tests/ui/async-await/async-await-let-else.stderr b/tests/ui/async-await/async-await-let-else.stderr
index 9a1c1782233..c3b4e761824 100644
--- a/tests/ui/async-await/async-await-let-else.stderr
+++ b/tests/ui/async-await/async-await-let-else.stderr
@@ -22,7 +22,7 @@ error[E0277]: `Rc<()>` cannot be sent between threads safely
   --> $DIR/async-await-let-else.rs:47:13
    |
 LL | async fn foo2(x: Option<bool>) {
-   |                                - within this `impl Future<Output = ()>`
+   | ------------------------------ within this `impl Future<Output = ()>`
 ...
 LL |     is_send(foo2(Some(true)));
    |     ------- ^^^^^^^^^^^^^^^^ `Rc<()>` cannot be sent between threads safely
diff --git a/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.stderr b/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.stderr
index 168ef8e9ee4..3f1f1766eb5 100644
--- a/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.stderr
+++ b/tests/ui/async-await/in-trait/async-example-desugared-boxed-in-trait.stderr
@@ -1,8 +1,8 @@
 error[E0053]: method `foo` has an incompatible type for trait
-  --> $DIR/async-example-desugared-boxed-in-trait.rs:15:28
+  --> $DIR/async-example-desugared-boxed-in-trait.rs:15:5
    |
 LL |     async fn foo(&self) -> i32 {
-   |                            ^^^ expected `Pin<Box<dyn Future<Output = i32>>>`, found future
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Pin<Box<dyn Future<Output = i32>>>`, found future
    |
 note: type in trait
   --> $DIR/async-example-desugared-boxed-in-trait.rs:11:22
diff --git a/tests/ui/async-await/in-trait/async-generics-and-bounds.stderr b/tests/ui/async-await/in-trait/async-generics-and-bounds.stderr
index 5c8d64fc6cb..90b40e221e4 100644
--- a/tests/ui/async-await/in-trait/async-generics-and-bounds.stderr
+++ b/tests/ui/async-await/in-trait/async-generics-and-bounds.stderr
@@ -1,8 +1,8 @@
 error[E0311]: the parameter type `U` may not live long enough
-  --> $DIR/async-generics-and-bounds.rs:12:28
+  --> $DIR/async-generics-and-bounds.rs:12:5
    |
 LL |     async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
-   |                            ^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: the parameter type `U` must be valid for the anonymous lifetime as defined here...
   --> $DIR/async-generics-and-bounds.rs:12:18
@@ -10,16 +10,16 @@ note: the parameter type `U` must be valid for the anonymous lifetime as defined
 LL |     async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
    |                  ^
 note: ...so that the reference type `&(T, U)` does not outlive the data it points at
-  --> $DIR/async-generics-and-bounds.rs:12:28
+  --> $DIR/async-generics-and-bounds.rs:12:5
    |
 LL |     async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
-   |                            ^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0311]: the parameter type `T` may not live long enough
-  --> $DIR/async-generics-and-bounds.rs:12:28
+  --> $DIR/async-generics-and-bounds.rs:12:5
    |
 LL |     async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
-   |                            ^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: the parameter type `T` must be valid for the anonymous lifetime as defined here...
   --> $DIR/async-generics-and-bounds.rs:12:18
@@ -27,10 +27,10 @@ note: the parameter type `T` must be valid for the anonymous lifetime as defined
 LL |     async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
    |                  ^
 note: ...so that the reference type `&(T, U)` does not outlive the data it points at
-  --> $DIR/async-generics-and-bounds.rs:12:28
+  --> $DIR/async-generics-and-bounds.rs:12:5
    |
 LL |     async fn foo(&self) -> &(T, U) where T: Debug + Sized, U: Hash;
-   |                            ^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/async-await/in-trait/async-generics.stderr b/tests/ui/async-await/in-trait/async-generics.stderr
index 6ae73d9e3a6..07f986e94e0 100644
--- a/tests/ui/async-await/in-trait/async-generics.stderr
+++ b/tests/ui/async-await/in-trait/async-generics.stderr
@@ -1,8 +1,8 @@
 error[E0311]: the parameter type `U` may not live long enough
-  --> $DIR/async-generics.rs:9:28
+  --> $DIR/async-generics.rs:9:5
    |
 LL |     async fn foo(&self) -> &(T, U);
-   |                            ^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: the parameter type `U` must be valid for the anonymous lifetime as defined here...
   --> $DIR/async-generics.rs:9:18
@@ -10,16 +10,16 @@ note: the parameter type `U` must be valid for the anonymous lifetime as defined
 LL |     async fn foo(&self) -> &(T, U);
    |                  ^
 note: ...so that the reference type `&(T, U)` does not outlive the data it points at
-  --> $DIR/async-generics.rs:9:28
+  --> $DIR/async-generics.rs:9:5
    |
 LL |     async fn foo(&self) -> &(T, U);
-   |                            ^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0311]: the parameter type `T` may not live long enough
-  --> $DIR/async-generics.rs:9:28
+  --> $DIR/async-generics.rs:9:5
    |
 LL |     async fn foo(&self) -> &(T, U);
-   |                            ^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
 note: the parameter type `T` must be valid for the anonymous lifetime as defined here...
   --> $DIR/async-generics.rs:9:18
@@ -27,10 +27,10 @@ note: the parameter type `T` must be valid for the anonymous lifetime as defined
 LL |     async fn foo(&self) -> &(T, U);
    |                  ^
 note: ...so that the reference type `&(T, U)` does not outlive the data it points at
-  --> $DIR/async-generics.rs:9:28
+  --> $DIR/async-generics.rs:9:5
    |
 LL |     async fn foo(&self) -> &(T, U);
-   |                            ^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/async-await/in-trait/async-recursive-generic.stderr b/tests/ui/async-await/in-trait/async-recursive-generic.stderr
index cab173bdd5b..6897bf1c999 100644
--- a/tests/ui/async-await/in-trait/async-recursive-generic.stderr
+++ b/tests/ui/async-await/in-trait/async-recursive-generic.stderr
@@ -1,8 +1,8 @@
 error[E0733]: recursion in an `async fn` requires boxing
-  --> $DIR/async-recursive-generic.rs:11:48
+  --> $DIR/async-recursive-generic.rs:11:5
    |
 LL |     async fn foo_recursive(&self, n: usize) -> T {
-   |                                                ^ recursive `async fn`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ recursive `async fn`
    |
    = note: a recursive `async fn` must be rewritten to return a boxed `dyn Future`
    = note: consider using the `async_recursion` crate: https://crates.io/crates/async_recursion
diff --git a/tests/ui/async-await/in-trait/async-recursive.stderr b/tests/ui/async-await/in-trait/async-recursive.stderr
index 9feff37b3fe..c9b4784e3b4 100644
--- a/tests/ui/async-await/in-trait/async-recursive.stderr
+++ b/tests/ui/async-await/in-trait/async-recursive.stderr
@@ -1,8 +1,8 @@
 error[E0733]: recursion in an `async fn` requires boxing
-  --> $DIR/async-recursive.rs:11:48
+  --> $DIR/async-recursive.rs:11:5
    |
 LL |     async fn foo_recursive(&self, n: usize) -> i32 {
-   |                                                ^^^ recursive `async fn`
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ recursive `async fn`
    |
    = note: a recursive `async fn` must be rewritten to return a boxed `dyn Future`
    = note: consider using the `async_recursion` crate: https://crates.io/crates/async_recursion
diff --git a/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.stderr b/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.stderr
index 7c750bf5101..4ba6d4cba0c 100644
--- a/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.stderr
+++ b/tests/ui/async-await/in-trait/dont-project-to-specializable-projection.stderr
@@ -1,14 +1,14 @@
 error[E0053]: method `foo` has an incompatible type for trait
-  --> $DIR/dont-project-to-specializable-projection.rs:14:35
+  --> $DIR/dont-project-to-specializable-projection.rs:14:5
    |
 LL |     default async fn foo(_: T) -> &'static str {
-   |                                   ^^^^^^^^^^^^ expected associated type, found future
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected associated type, found future
    |
 note: type in trait
-  --> $DIR/dont-project-to-specializable-projection.rs:10:27
+  --> $DIR/dont-project-to-specializable-projection.rs:10:5
    |
 LL |     async fn foo(_: T) -> &'static str;
-   |                           ^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: expected signature `fn(_) -> impl Future<Output = &'static str>`
               found signature `fn(_) -> impl Future<Output = &'static str>`
 
diff --git a/tests/ui/async-await/issue-64130-3-other.stderr b/tests/ui/async-await/issue-64130-3-other.stderr
index 573da1034c5..4bbb7731b11 100644
--- a/tests/ui/async-await/issue-64130-3-other.stderr
+++ b/tests/ui/async-await/issue-64130-3-other.stderr
@@ -2,7 +2,7 @@ error[E0277]: the trait bound `Foo: Qux` is not satisfied in `impl Future<Output
   --> $DIR/issue-64130-3-other.rs:25:12
    |
 LL | async fn bar() {
-   |                - within this `impl Future<Output = ()>`
+   | -------------- within this `impl Future<Output = ()>`
 ...
 LL |     is_qux(bar());
    |            ^^^^^ within `impl Future<Output = ()>`, the trait `Qux` is not implemented for `Foo`
diff --git a/tests/ui/async-await/issues/issue-67893.stderr b/tests/ui/async-await/issues/issue-67893.stderr
index f36269e8f36..3d6d1fb5c09 100644
--- a/tests/ui/async-await/issues/issue-67893.stderr
+++ b/tests/ui/async-await/issues/issue-67893.stderr
@@ -6,10 +6,10 @@ LL |     g(issue_67893::run())
    |     |
    |     required by a bound introduced by this call
    |
-  ::: $DIR/auxiliary/issue_67893.rs:9:20
+  ::: $DIR/auxiliary/issue_67893.rs:9:1
    |
 LL | pub async fn run() {
-   |                    - within this `impl Future<Output = ()>`
+   | ------------------ within this `impl Future<Output = ()>`
    |
    = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `MutexGuard<'_, ()>`
    = note: required because it captures the following types: `Arc<Mutex<()>>`, `MutexGuard<'_, ()>`, `impl Future<Output = ()>`
diff --git a/tests/ui/async-await/mutually-recursive-async-impl-trait-type.stderr b/tests/ui/async-await/mutually-recursive-async-impl-trait-type.stderr
index f789ad2a05c..9442609e805 100644
--- a/tests/ui/async-await/mutually-recursive-async-impl-trait-type.stderr
+++ b/tests/ui/async-await/mutually-recursive-async-impl-trait-type.stderr
@@ -1,17 +1,17 @@
 error[E0733]: recursion in an `async fn` requires boxing
-  --> $DIR/mutually-recursive-async-impl-trait-type.rs:5:18
+  --> $DIR/mutually-recursive-async-impl-trait-type.rs:5:1
    |
 LL | async fn rec_1() {
-   |                  ^ recursive `async fn`
+   | ^^^^^^^^^^^^^^^^ recursive `async fn`
    |
    = note: a recursive `async fn` must be rewritten to return a boxed `dyn Future`
    = note: consider using the `async_recursion` crate: https://crates.io/crates/async_recursion
 
 error[E0733]: recursion in an `async fn` requires boxing
-  --> $DIR/mutually-recursive-async-impl-trait-type.rs:9:18
+  --> $DIR/mutually-recursive-async-impl-trait-type.rs:9:1
    |
 LL | async fn rec_2() {
-   |                  ^ recursive `async fn`
+   | ^^^^^^^^^^^^^^^^ recursive `async fn`
    |
    = note: a recursive `async fn` must be rewritten to return a boxed `dyn Future`
    = note: consider using the `async_recursion` crate: https://crates.io/crates/async_recursion
diff --git a/tests/ui/async-await/partial-drop-partial-reinit.stderr b/tests/ui/async-await/partial-drop-partial-reinit.stderr
index 85e1830c78e..d115c1b1cc4 100644
--- a/tests/ui/async-await/partial-drop-partial-reinit.stderr
+++ b/tests/ui/async-await/partial-drop-partial-reinit.stderr
@@ -7,7 +7,7 @@ LL |     gimme_send(foo());
    |     required by a bound introduced by this call
 ...
 LL | async fn foo() {
-   |                - within this `impl Future<Output = ()>`
+   | -------------- within this `impl Future<Output = ()>`
    |
    = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `NotSend`
    = note: required because it appears within the type `(NotSend,)`
diff --git a/tests/ui/async-await/recursive-async-impl-trait-type.stderr b/tests/ui/async-await/recursive-async-impl-trait-type.stderr
index 63f64f44557..64917329c49 100644
--- a/tests/ui/async-await/recursive-async-impl-trait-type.stderr
+++ b/tests/ui/async-await/recursive-async-impl-trait-type.stderr
@@ -1,8 +1,8 @@
 error[E0733]: recursion in an `async fn` requires boxing
-  --> $DIR/recursive-async-impl-trait-type.rs:5:40
+  --> $DIR/recursive-async-impl-trait-type.rs:5:1
    |
 LL | async fn recursive_async_function() -> () {
-   |                                        ^^ recursive `async fn`
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ recursive `async fn`
    |
    = note: a recursive `async fn` must be rewritten to return a boxed `dyn Future`
    = note: consider using the `async_recursion` crate: https://crates.io/crates/async_recursion
diff --git a/tests/ui/suggestions/impl-trait-missing-lifetime.stderr b/tests/ui/suggestions/impl-trait-missing-lifetime.stderr
index b476d61017f..2c29cfa0b91 100644
--- a/tests/ui/suggestions/impl-trait-missing-lifetime.stderr
+++ b/tests/ui/suggestions/impl-trait-missing-lifetime.stderr
@@ -26,9 +26,9 @@ error: lifetime may not live long enough
   --> $DIR/impl-trait-missing-lifetime.rs:16:69
    |
 LL | async fn i(mut x: impl Iterator<Item = &'_ ()>) -> Option<&'_ ()> { x.next() }
-   |                                                    --------------   ^^^^^^^^ returning this value requires that `'1` must outlive `'static`
-   |                                                    |
-   |                                                    return type `impl Future<Output = Option<&'static ()>>` contains a lifetime `'1`
+   | -----------------------------------------------------------------   ^^^^^^^^ returning this value requires that `'1` must outlive `'static`
+   | |
+   | return type `impl Future<Output = Option<&'static ()>>` contains a lifetime `'1`
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/suggestions/suggest-ret-on-async-w-late.stderr b/tests/ui/suggestions/suggest-ret-on-async-w-late.stderr
index bff864b222b..36cabab758f 100644
--- a/tests/ui/suggestions/suggest-ret-on-async-w-late.stderr
+++ b/tests/ui/suggestions/suggest-ret-on-async-w-late.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/suggest-ret-on-async-w-late.rs:7:5
    |
 LL | async fn ice(_: &i32) {
-   |                       - help: try adding a return type: `-> bool`
+   | --------------------- help: try adding a return type: `-> bool`
 LL |     true
    |     ^^^^ expected `()`, found `bool`
 
diff --git a/tests/ui/typeck/issue-90027-async-fn-return-suggestion.stderr b/tests/ui/typeck/issue-90027-async-fn-return-suggestion.stderr
index 0d72ae118f3..e367e04c375 100644
--- a/tests/ui/typeck/issue-90027-async-fn-return-suggestion.stderr
+++ b/tests/ui/typeck/issue-90027-async-fn-return-suggestion.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-90027-async-fn-return-suggestion.rs:4:5
    |
 LL | async fn hello() {
-   |                  - help: try adding a return type: `-> i32`
+   | ---------------- help: try adding a return type: `-> i32`
 LL |     0
    |     ^ expected `()`, found integer
 
@@ -10,7 +10,7 @@ error[E0308]: mismatched types
   --> $DIR/issue-90027-async-fn-return-suggestion.rs:9:5
    |
 LL | async fn world() -> () {
-   |                     -- expected `()` because of return type
+   | ---------------------- expected `()` because of return type
 LL |     0
    |     ^ expected `()`, found integer