about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir4
-rw-r--r--tests/ui/async-await/generator-desc.stderr14
-rw-r--r--tests/ui/async-await/large_moves.attribute.stderr22
-rw-r--r--tests/ui/async-await/large_moves.option.stderr22
-rw-r--r--tests/ui/async-await/large_moves.rs2
-rw-r--r--tests/ui/async-await/no-const-async.rs1
-rw-r--r--tests/ui/async-await/no-const-async.stderr33
-rw-r--r--tests/ui/async-await/track-caller/async-block.rs4
-rw-r--r--tests/ui/async-await/track-caller/async-block.stderr14
-rw-r--r--tests/ui/async-await/track-caller/panic-track-caller.rs13
-rw-r--r--tests/ui/chalkify/bugs/async.rs2
-rw-r--r--tests/ui/chalkify/bugs/async.stderr34
-rw-r--r--tests/ui/feature-gates/feature-gate-closure_track_caller.rs2
-rw-r--r--tests/ui/feature-gates/feature-gate-closure_track_caller.stderr15
-rw-r--r--tests/ui/impl-trait/in-trait/default-body-with-rpit.rs2
-rw-r--r--tests/ui/impl-trait/in-trait/default-body-with-rpit.stderr24
-rw-r--r--tests/ui/impl-trait/issues/issue-78722.rs1
-rw-r--r--tests/ui/impl-trait/issues/issue-78722.stderr13
-rw-r--r--tests/ui/parser/fn-header-semantic-fail.rs3
-rw-r--r--tests/ui/parser/fn-header-semantic-fail.stderr146
-rw-r--r--tests/ui/suggestions/expected-boxed-future-isnt-pinned.stderr11
21 files changed, 109 insertions, 273 deletions
diff --git a/tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir b/tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir
index ad4e5c6fcfd..9ad8a70a2ce 100644
--- a/tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir
+++ b/tests/mir-opt/building/async_await.b-{closure#0}.generator_resume.0.mir
@@ -4,7 +4,7 @@
         _0: GeneratorSavedTy {
             ty: impl std::future::Future<Output = ()>,
             source_info: SourceInfo {
-                span: $DIR/async_await.rs:15:8: 15:14 (#9),
+                span: $DIR/async_await.rs:15:8: 15:14 (#8),
                 scope: scope[0],
             },
             ignore_for_traits: false,
@@ -12,7 +12,7 @@
         _1: GeneratorSavedTy {
             ty: impl std::future::Future<Output = ()>,
             source_info: SourceInfo {
-                span: $DIR/async_await.rs:16:8: 16:14 (#12),
+                span: $DIR/async_await.rs:16:8: 16:14 (#11),
                 scope: scope[0],
             },
             ignore_for_traits: false,
diff --git a/tests/ui/async-await/generator-desc.stderr b/tests/ui/async-await/generator-desc.stderr
index 51ac9d86bfb..042766f19ca 100644
--- a/tests/ui/async-await/generator-desc.stderr
+++ b/tests/ui/async-await/generator-desc.stderr
@@ -2,16 +2,18 @@ error[E0308]: mismatched types
   --> $DIR/generator-desc.rs:10:19
    |
 LL |     fun(async {}, async {});
-   |         --------  ^^^^^^^^
-   |         |         |
-   |         |         expected `async` block, found a different `async` block
-   |         |         arguments to this function are incorrect
-   |         the expected `async` block
+   |     --- --------  ^^^^^^^^ expected `async` block, found a different `async` block
+   |     |   |
+   |     |   the expected `async` block
+   |     arguments to this function are incorrect
    |
    = note: expected `async` block `[async block@$DIR/generator-desc.rs:10:9: 10:17]`
               found `async` block `[async block@$DIR/generator-desc.rs:10:19: 10:27]`
 note: function defined here
-  --> $SRC_DIR/core/src/future/mod.rs:LL:COL
+  --> $DIR/generator-desc.rs:8:4
+   |
+LL | fn fun<F: Future<Output = ()>>(f1: F, f2: F) {}
+   |    ^^^                                -----
 
 error[E0308]: mismatched types
   --> $DIR/generator-desc.rs:12:16
diff --git a/tests/ui/async-await/large_moves.attribute.stderr b/tests/ui/async-await/large_moves.attribute.stderr
index 0c5452475a6..94f61caa25d 100644
--- a/tests/ui/async-await/large_moves.attribute.stderr
+++ b/tests/ui/async-await/large_moves.attribute.stderr
@@ -1,14 +1,8 @@
 error: moving 10024 bytes
-  --> $DIR/large_moves.rs:13:13
+  --> $DIR/large_moves.rs:19:14
    |
-LL |       let x = async {
-   |  _____________^
-LL | |         let y = [0; 9999];
-LL | |         dbg!(y);
-LL | |         thing(&y).await;
-LL | |         dbg!(y);
-LL | |     };
-   | |_____^ value moved from here
+LL |     let z = (x, 42);
+   |              ^ value moved from here
    |
    = note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
 note: the lint level is defined here
@@ -18,14 +12,6 @@ LL | #![deny(large_assignments)]
    |         ^^^^^^^^^^^^^^^^^
 
 error: moving 10024 bytes
-  --> $DIR/large_moves.rs:19:14
-   |
-LL |     let z = (x, 42);
-   |              ^ value moved from here
-   |
-   = note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
-
-error: moving 10024 bytes
   --> $DIR/large_moves.rs:19:13
    |
 LL |     let z = (x, 42);
@@ -41,5 +27,5 @@ LL |     let a = z.0;
    |
    = note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
 
-error: aborting due to 4 previous errors
+error: aborting due to 3 previous errors
 
diff --git a/tests/ui/async-await/large_moves.option.stderr b/tests/ui/async-await/large_moves.option.stderr
index 0c5452475a6..94f61caa25d 100644
--- a/tests/ui/async-await/large_moves.option.stderr
+++ b/tests/ui/async-await/large_moves.option.stderr
@@ -1,14 +1,8 @@
 error: moving 10024 bytes
-  --> $DIR/large_moves.rs:13:13
+  --> $DIR/large_moves.rs:19:14
    |
-LL |       let x = async {
-   |  _____________^
-LL | |         let y = [0; 9999];
-LL | |         dbg!(y);
-LL | |         thing(&y).await;
-LL | |         dbg!(y);
-LL | |     };
-   | |_____^ value moved from here
+LL |     let z = (x, 42);
+   |              ^ value moved from here
    |
    = note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
 note: the lint level is defined here
@@ -18,14 +12,6 @@ LL | #![deny(large_assignments)]
    |         ^^^^^^^^^^^^^^^^^
 
 error: moving 10024 bytes
-  --> $DIR/large_moves.rs:19:14
-   |
-LL |     let z = (x, 42);
-   |              ^ value moved from here
-   |
-   = note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
-
-error: moving 10024 bytes
   --> $DIR/large_moves.rs:19:13
    |
 LL |     let z = (x, 42);
@@ -41,5 +27,5 @@ LL |     let a = z.0;
    |
    = note: The current maximum size is 1000, but it can be customized with the move_size_limit attribute: `#![move_size_limit = "..."]`
 
-error: aborting due to 4 previous errors
+error: aborting due to 3 previous errors
 
diff --git a/tests/ui/async-await/large_moves.rs b/tests/ui/async-await/large_moves.rs
index d43d0eec0ca..c8ed6bafe9c 100644
--- a/tests/ui/async-await/large_moves.rs
+++ b/tests/ui/async-await/large_moves.rs
@@ -10,7 +10,7 @@
 // compile-flags: -Zmir-opt-level=0
 
 fn main() {
-    let x = async { //~ ERROR large_assignments
+    let x = async {
         let y = [0; 9999];
         dbg!(y);
         thing(&y).await;
diff --git a/tests/ui/async-await/no-const-async.rs b/tests/ui/async-await/no-const-async.rs
index cfb0ef1b33a..b3c59734e03 100644
--- a/tests/ui/async-await/no-const-async.rs
+++ b/tests/ui/async-await/no-const-async.rs
@@ -3,4 +3,3 @@
 
 pub const async fn x() {}
 //~^ ERROR functions cannot be both `const` and `async`
-//~| ERROR cycle detected
diff --git a/tests/ui/async-await/no-const-async.stderr b/tests/ui/async-await/no-const-async.stderr
index 71c228958f6..90ec646c8c0 100644
--- a/tests/ui/async-await/no-const-async.stderr
+++ b/tests/ui/async-await/no-const-async.stderr
@@ -7,36 +7,5 @@ LL | pub const async fn x() {}
    |     |     `async` because of this
    |     `const` because of this
 
-error[E0391]: cycle detected when computing type of `x::{opaque#0}`
-  --> $DIR/no-const-async.rs:4:24
-   |
-LL | pub const async fn x() {}
-   |                        ^
-   |
-note: ...which requires borrow-checking `x`...
-  --> $DIR/no-const-async.rs:4:1
-   |
-LL | pub const async fn x() {}
-   | ^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires processing MIR for `x`...
-  --> $DIR/no-const-async.rs:4:1
-   |
-LL | pub const async fn x() {}
-   | ^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires const checking `x`...
-  --> $DIR/no-const-async.rs:4:1
-   |
-LL | pub const async fn x() {}
-   | ^^^^^^^^^^^^^^^^^^^^^^
-   = note: ...which requires computing whether `x::{opaque#0}` is freeze...
-   = note: ...which requires evaluating trait selection obligation `x::{opaque#0}: core::marker::Freeze`...
-   = note: ...which again requires computing type of `x::{opaque#0}`, completing the cycle
-note: cycle used when checking item types in top-level module
-  --> $DIR/no-const-async.rs:4:1
-   |
-LL | pub const async fn x() {}
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0391`.
diff --git a/tests/ui/async-await/track-caller/async-block.rs b/tests/ui/async-await/track-caller/async-block.rs
index 8e81387c34b..8ddd4ab1186 100644
--- a/tests/ui/async-await/track-caller/async-block.rs
+++ b/tests/ui/async-await/track-caller/async-block.rs
@@ -1,9 +1,9 @@
 // edition:2021
 
-#![feature(closure_track_caller, stmt_expr_attributes)]
+#![feature(stmt_expr_attributes)]
 
 fn main() {
     let _ = #[track_caller] async {
-        //~^ ERROR attribute should be applied to a function definition [E0739]
+        //~^ ERROR `#[track_caller]` on closures is currently unstable [E0658]
     };
 }
diff --git a/tests/ui/async-await/track-caller/async-block.stderr b/tests/ui/async-await/track-caller/async-block.stderr
index 407439921c0..21d1054d220 100644
--- a/tests/ui/async-await/track-caller/async-block.stderr
+++ b/tests/ui/async-await/track-caller/async-block.stderr
@@ -1,12 +1,12 @@
-error[E0739]: attribute should be applied to a function definition
+error[E0658]: `#[track_caller]` on closures is currently unstable
   --> $DIR/async-block.rs:6:13
    |
-LL |       let _ = #[track_caller] async {
-   |  _____________^^^^^^^^^^^^^^^_-
-LL | |
-LL | |     };
-   | |_____- not a function definition
+LL |     let _ = #[track_caller] async {
+   |             ^^^^^^^^^^^^^^^
+   |
+   = note: see issue #87417 <https://github.com/rust-lang/rust/issues/87417> for more information
+   = help: add `#![feature(closure_track_caller)]` to the crate attributes to enable
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0739`.
+For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/async-await/track-caller/panic-track-caller.rs b/tests/ui/async-await/track-caller/panic-track-caller.rs
index f45243b0ea6..65bb23e0b4b 100644
--- a/tests/ui/async-await/track-caller/panic-track-caller.rs
+++ b/tests/ui/async-await/track-caller/panic-track-caller.rs
@@ -79,6 +79,16 @@ async fn foo_closure() {
     c().await
 }
 
+// Since compilation is expected to fail for this fn when using
+// `nofeat`, we test that separately in `async-block.rs`
+#[cfg(feat)]
+async fn foo_block() {
+    let a = #[track_caller] async {
+        panic!();
+    };
+    a.await
+}
+
 fn panicked_at(f: impl FnOnce() + panic::UnwindSafe) -> u32 {
     let loc = Arc::new(Mutex::new(None));
 
@@ -110,4 +120,7 @@ fn main() {
 
     #[cfg(feat)]
     assert_eq!(panicked_at(|| block_on(foo_closure())), 79);
+
+    #[cfg(feat)]
+    assert_eq!(panicked_at(|| block_on(foo_block())), 89);
 }
diff --git a/tests/ui/chalkify/bugs/async.rs b/tests/ui/chalkify/bugs/async.rs
index 3169e4781ee..a1ef4732b63 100644
--- a/tests/ui/chalkify/bugs/async.rs
+++ b/tests/ui/chalkify/bugs/async.rs
@@ -4,7 +4,7 @@
 // compile-flags:-Z trait-solver=chalk
 // error-pattern:internal compiler error
 // failure-status:101
-// normalize-stderr-test "DefId([^)]*)" -> "..."
+// normalize-stderr-test "DefId\([^)]*\)" -> "..."
 // normalize-stderr-test "\nerror: internal compiler error.*\n\n" -> ""
 // normalize-stderr-test "note:.*unexpectedly panicked.*\n\n" -> ""
 // normalize-stderr-test "note: we would appreciate a bug report.*\n\n" -> ""
diff --git a/tests/ui/chalkify/bugs/async.stderr b/tests/ui/chalkify/bugs/async.stderr
index 8043f1e5a05..9c559640b23 100644
--- a/tests/ui/chalkify/bugs/async.stderr
+++ b/tests/ui/chalkify/bugs/async.stderr
@@ -1,34 +1,4 @@
 error[E0277]: `[async fn body@$DIR/async.rs:23:29: 25:2]` is not a future
-  --> $DIR/async.rs:23:29
-   |
-LL |   async fn foo(x: u32) -> u32 {
-   |  _____________________________-
-LL | |     x
-LL | | }
-   | | ^
-   | | |
-   | |_`[async fn body@$DIR/async.rs:23:29: 25:2]` is not a future
-   |   required by a bound introduced by this call
-   |
-   = help: the trait `Future` is not implemented for `[async fn body@$DIR/async.rs:23:29: 25:2]`
-   = note: [async fn body@$DIR/async.rs:23:29: 25:2] must be a future or must implement `IntoFuture` to be awaited
-note: required by a bound in `identity_future`
-  --> $SRC_DIR/core/src/future/mod.rs:LL:COL
-
-error[E0277]: the size for values of type `<[async fn body@$DIR/async.rs:23:29: 25:2] as Future>::Output` cannot be known at compilation time
-  --> $DIR/async.rs:23:29
-   |
-LL |   async fn foo(x: u32) -> u32 {
-   |  _____________________________^
-LL | |     x
-LL | | }
-   | |_^ doesn't have a size known at compile-time
-   |
-   = help: the trait `Sized` is not implemented for `<[async fn body@$DIR/async.rs:23:29: 25:2] as Future>::Output`
-note: required by a bound in `identity_future`
-  --> $SRC_DIR/core/src/future/mod.rs:LL:COL
-
-error[E0277]: `[async fn body@$DIR/async.rs:23:29: 25:2]` is not a future
   --> $DIR/async.rs:23:25
    |
 LL | async fn foo(x: u32) -> u32 {
@@ -37,7 +7,7 @@ LL | async fn foo(x: u32) -> u32 {
    = help: the trait `Future` is not implemented for `[async fn body@$DIR/async.rs:23:29: 25:2]`
    = note: [async fn body@$DIR/async.rs:23:29: 25:2] must be a future or must implement `IntoFuture` to be awaited
 
-error: internal compiler error: projection clauses should be implied from elsewhere. obligation: `Obligation(predicate=Binder(ProjectionPredicate(AliasTy { substs: [[async fn body@$DIR/async.rs:23:29: 25:2]], def_id: ...) }, Term::Ty(u32)), []), depth=0)`
+error: internal compiler error: projection clauses should be implied from elsewhere. obligation: `Obligation(predicate=Binder(ProjectionPredicate(AliasTy { substs: [[async fn body@$DIR/async.rs:23:29: 25:2]], def_id: ... }, Term::Ty(u32)), []), depth=0)`
   --> $DIR/async.rs:23:25
    |
 LL | async fn foo(x: u32) -> u32 {
@@ -53,6 +23,6 @@ LL | async fn foo(x: u32) -> u32 {
 #8 [check_mod_item_types] checking item types in top-level module
 #9 [analysis] running analysis passes on this crate
 end of query stack
-error: aborting due to 4 previous errors
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/feature-gates/feature-gate-closure_track_caller.rs b/tests/ui/feature-gates/feature-gate-closure_track_caller.rs
index a8d63a8145a..a4c91f3bc18 100644
--- a/tests/ui/feature-gates/feature-gate-closure_track_caller.rs
+++ b/tests/ui/feature-gates/feature-gate-closure_track_caller.rs
@@ -1,7 +1,9 @@
+// edition:2021
 #![feature(stmt_expr_attributes)]
 #![feature(generators)]
 
 fn main() {
     let _closure = #[track_caller] || {}; //~ `#[track_caller]` on closures
     let _generator = #[track_caller] || { yield; }; //~ `#[track_caller]` on closures
+    let _future = #[track_caller] async {}; //~ `#[track_caller]` on closures
 }
diff --git a/tests/ui/feature-gates/feature-gate-closure_track_caller.stderr b/tests/ui/feature-gates/feature-gate-closure_track_caller.stderr
index ed63d74fe4d..cf2ea5fe1ca 100644
--- a/tests/ui/feature-gates/feature-gate-closure_track_caller.stderr
+++ b/tests/ui/feature-gates/feature-gate-closure_track_caller.stderr
@@ -1,5 +1,5 @@
 error[E0658]: `#[track_caller]` on closures is currently unstable
-  --> $DIR/feature-gate-closure_track_caller.rs:5:20
+  --> $DIR/feature-gate-closure_track_caller.rs:6:20
    |
 LL |     let _closure = #[track_caller] || {};
    |                    ^^^^^^^^^^^^^^^
@@ -8,7 +8,7 @@ LL |     let _closure = #[track_caller] || {};
    = help: add `#![feature(closure_track_caller)]` to the crate attributes to enable
 
 error[E0658]: `#[track_caller]` on closures is currently unstable
-  --> $DIR/feature-gate-closure_track_caller.rs:6:22
+  --> $DIR/feature-gate-closure_track_caller.rs:7:22
    |
 LL |     let _generator = #[track_caller] || { yield; };
    |                      ^^^^^^^^^^^^^^^
@@ -16,6 +16,15 @@ LL |     let _generator = #[track_caller] || { yield; };
    = note: see issue #87417 <https://github.com/rust-lang/rust/issues/87417> for more information
    = help: add `#![feature(closure_track_caller)]` to the crate attributes to enable
 
-error: aborting due to 2 previous errors
+error[E0658]: `#[track_caller]` on closures is currently unstable
+  --> $DIR/feature-gate-closure_track_caller.rs:8:19
+   |
+LL |     let _future = #[track_caller] async {};
+   |                   ^^^^^^^^^^^^^^^
+   |
+   = note: see issue #87417 <https://github.com/rust-lang/rust/issues/87417> for more information
+   = help: add `#![feature(closure_track_caller)]` to the crate attributes to enable
+
+error: aborting due to 3 previous errors
 
 For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/impl-trait/in-trait/default-body-with-rpit.rs b/tests/ui/impl-trait/in-trait/default-body-with-rpit.rs
index ad3cc7c2524..0558d95128f 100644
--- a/tests/ui/impl-trait/in-trait/default-body-with-rpit.rs
+++ b/tests/ui/impl-trait/in-trait/default-body-with-rpit.rs
@@ -1,5 +1,5 @@
-// check-pass
 // edition:2021
+// known-bug: #108304
 
 #![feature(async_fn_in_trait, return_position_impl_trait_in_trait)]
 #![allow(incomplete_features)]
diff --git a/tests/ui/impl-trait/in-trait/default-body-with-rpit.stderr b/tests/ui/impl-trait/in-trait/default-body-with-rpit.stderr
new file mode 100644
index 00000000000..b5fc9d44d36
--- /dev/null
+++ b/tests/ui/impl-trait/in-trait/default-body-with-rpit.stderr
@@ -0,0 +1,24 @@
+error: concrete type differs from previous defining opaque type use
+  --> $DIR/default-body-with-rpit.rs:11:9
+   |
+LL |         ""
+   |         ^^ expected `impl Debug`, got `&'static str`
+   |
+note: previous use here
+  --> $DIR/default-body-with-rpit.rs:10:39
+   |
+LL |       async fn baz(&self) -> impl Debug {
+   |  _______________________________________^
+LL | |         ""
+LL | |     }
+   | |_____^
+
+error[E0720]: cannot resolve opaque type
+  --> $DIR/default-body-with-rpit.rs:10:28
+   |
+LL |     async fn baz(&self) -> impl Debug {
+   |                            ^^^^^^^^^^ cannot resolve opaque type
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0720`.
diff --git a/tests/ui/impl-trait/issues/issue-78722.rs b/tests/ui/impl-trait/issues/issue-78722.rs
index 78233f300bd..7b5ab5f2298 100644
--- a/tests/ui/impl-trait/issues/issue-78722.rs
+++ b/tests/ui/impl-trait/issues/issue-78722.rs
@@ -12,7 +12,6 @@ struct Bug {
         }
         let f: F = async { 1 };
         //~^ ERROR `async` blocks are not allowed in constants
-        //~| ERROR destructor of
         1
     }],
 }
diff --git a/tests/ui/impl-trait/issues/issue-78722.stderr b/tests/ui/impl-trait/issues/issue-78722.stderr
index c00df8087e8..05a2c135cf7 100644
--- a/tests/ui/impl-trait/issues/issue-78722.stderr
+++ b/tests/ui/impl-trait/issues/issue-78722.stderr
@@ -7,22 +7,13 @@ LL |         let f: F = async { 1 };
    = note: see issue #85368 <https://github.com/rust-lang/rust/issues/85368> for more information
    = help: add `#![feature(const_async_blocks)]` to the crate attributes to enable
 
-error[E0493]: destructor of `F` cannot be evaluated at compile-time
-  --> $DIR/issue-78722.rs:13:13
-   |
-LL |         let f: F = async { 1 };
-   |             ^ the destructor for this type cannot be evaluated in constants
-...
-LL |     }],
-   |     - value is dropped here
-
 error[E0271]: expected `[async block@$DIR/issue-78722.rs:11:13: 11:21]` to be a future that resolves to `u8`, but it resolves to `()`
   --> $DIR/issue-78722.rs:9:30
    |
 LL |         fn concrete_use() -> F {
    |                              ^ expected `()`, found `u8`
 
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
 
-Some errors have detailed explanations: E0271, E0493, E0658.
+Some errors have detailed explanations: E0271, E0658.
 For more information about an error, try `rustc --explain E0271`.
diff --git a/tests/ui/parser/fn-header-semantic-fail.rs b/tests/ui/parser/fn-header-semantic-fail.rs
index cf5d3dab4aa..71f18a27e7c 100644
--- a/tests/ui/parser/fn-header-semantic-fail.rs
+++ b/tests/ui/parser/fn-header-semantic-fail.rs
@@ -11,7 +11,6 @@ fn main() {
     extern "C" fn ff4() {} // OK.
     const async unsafe extern "C" fn ff5() {}
     //~^ ERROR functions cannot be both `const` and `async`
-    //~| ERROR cycle detected
 
     trait X {
         async fn ft1(); //~ ERROR functions in traits cannot be declared `async`
@@ -34,7 +33,6 @@ fn main() {
         //~^ ERROR functions in traits cannot be declared `async`
         //~| ERROR functions in traits cannot be declared const
         //~| ERROR functions cannot be both `const` and `async`
-        //~| ERROR cycle detected
     }
 
     impl Y {
@@ -44,7 +42,6 @@ fn main() {
         extern "C" fn fi4() {} // OK.
         const async unsafe extern "C" fn fi5() {}
         //~^ ERROR functions cannot be both `const` and `async`
-        //~| ERROR cycle detected
     }
 
     extern "C" {
diff --git a/tests/ui/parser/fn-header-semantic-fail.stderr b/tests/ui/parser/fn-header-semantic-fail.stderr
index 2d8bd19a731..7f7b7e835f8 100644
--- a/tests/ui/parser/fn-header-semantic-fail.stderr
+++ b/tests/ui/parser/fn-header-semantic-fail.stderr
@@ -8,19 +8,19 @@ LL |     const async unsafe extern "C" fn ff5() {}
    |     `const` because of this
 
 error[E0379]: functions in traits cannot be declared const
-  --> $DIR/fn-header-semantic-fail.rs:19:9
+  --> $DIR/fn-header-semantic-fail.rs:18:9
    |
 LL |         const fn ft3();
    |         ^^^^^ functions in traits cannot be const
 
 error[E0379]: functions in traits cannot be declared const
-  --> $DIR/fn-header-semantic-fail.rs:21:9
+  --> $DIR/fn-header-semantic-fail.rs:20:9
    |
 LL |         const async unsafe extern "C" fn ft5();
    |         ^^^^^ functions in traits cannot be const
 
 error: functions cannot be both `const` and `async`
-  --> $DIR/fn-header-semantic-fail.rs:21:9
+  --> $DIR/fn-header-semantic-fail.rs:20:9
    |
 LL |         const async unsafe extern "C" fn ft5();
    |         ^^^^^-^^^^^----------------------------
@@ -29,19 +29,19 @@ LL |         const async unsafe extern "C" fn ft5();
    |         `const` because of this
 
 error[E0379]: functions in traits cannot be declared const
-  --> $DIR/fn-header-semantic-fail.rs:31:9
+  --> $DIR/fn-header-semantic-fail.rs:30:9
    |
 LL |         const fn ft3() {}
    |         ^^^^^ functions in traits cannot be const
 
 error[E0379]: functions in traits cannot be declared const
-  --> $DIR/fn-header-semantic-fail.rs:33:9
+  --> $DIR/fn-header-semantic-fail.rs:32:9
    |
 LL |         const async unsafe extern "C" fn ft5() {}
    |         ^^^^^ functions in traits cannot be const
 
 error: functions cannot be both `const` and `async`
-  --> $DIR/fn-header-semantic-fail.rs:33:9
+  --> $DIR/fn-header-semantic-fail.rs:32:9
    |
 LL |         const async unsafe extern "C" fn ft5() {}
    |         ^^^^^-^^^^^------------------------------
@@ -50,7 +50,7 @@ LL |         const async unsafe extern "C" fn ft5() {}
    |         `const` because of this
 
 error: functions cannot be both `const` and `async`
-  --> $DIR/fn-header-semantic-fail.rs:45:9
+  --> $DIR/fn-header-semantic-fail.rs:43:9
    |
 LL |         const async unsafe extern "C" fn fi5() {}
    |         ^^^^^-^^^^^------------------------------
@@ -59,7 +59,7 @@ LL |         const async unsafe extern "C" fn fi5() {}
    |         `const` because of this
 
 error: functions in `extern` blocks cannot have qualifiers
-  --> $DIR/fn-header-semantic-fail.rs:51:18
+  --> $DIR/fn-header-semantic-fail.rs:48:18
    |
 LL |     extern "C" {
    |     ---------- in this `extern` block
@@ -72,7 +72,7 @@ LL |         fn fe1();
    |         ~~
 
 error: functions in `extern` blocks cannot have qualifiers
-  --> $DIR/fn-header-semantic-fail.rs:52:19
+  --> $DIR/fn-header-semantic-fail.rs:49:19
    |
 LL |     extern "C" {
    |     ---------- in this `extern` block
@@ -86,7 +86,7 @@ LL |         fn fe2();
    |         ~~
 
 error: functions in `extern` blocks cannot have qualifiers
-  --> $DIR/fn-header-semantic-fail.rs:53:18
+  --> $DIR/fn-header-semantic-fail.rs:50:18
    |
 LL |     extern "C" {
    |     ---------- in this `extern` block
@@ -100,7 +100,7 @@ LL |         fn fe3();
    |         ~~
 
 error: functions in `extern` blocks cannot have qualifiers
-  --> $DIR/fn-header-semantic-fail.rs:54:23
+  --> $DIR/fn-header-semantic-fail.rs:51:23
    |
 LL |     extern "C" {
    |     ---------- in this `extern` block
@@ -114,7 +114,7 @@ LL |         fn fe4();
    |         ~~
 
 error: functions in `extern` blocks cannot have qualifiers
-  --> $DIR/fn-header-semantic-fail.rs:55:42
+  --> $DIR/fn-header-semantic-fail.rs:52:42
    |
 LL |     extern "C" {
    |     ---------- in this `extern` block
@@ -128,7 +128,7 @@ LL |         fn fe5();
    |         ~~
 
 error: functions cannot be both `const` and `async`
-  --> $DIR/fn-header-semantic-fail.rs:55:9
+  --> $DIR/fn-header-semantic-fail.rs:52:9
    |
 LL |         const async unsafe extern "C" fn fe5();
    |         ^^^^^-^^^^^----------------------------
@@ -137,7 +137,7 @@ LL |         const async unsafe extern "C" fn fe5();
    |         `const` because of this
 
 error[E0706]: functions in traits cannot be declared `async`
-  --> $DIR/fn-header-semantic-fail.rs:17:9
+  --> $DIR/fn-header-semantic-fail.rs:16:9
    |
 LL |         async fn ft1();
    |         -----^^^^^^^^^^
@@ -150,7 +150,7 @@ LL |         async fn ft1();
    = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
 
 error[E0706]: functions in traits cannot be declared `async`
-  --> $DIR/fn-header-semantic-fail.rs:21:9
+  --> $DIR/fn-header-semantic-fail.rs:20:9
    |
 LL |         const async unsafe extern "C" fn ft5();
    |         ^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -163,7 +163,7 @@ LL |         const async unsafe extern "C" fn ft5();
    = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
 
 error[E0706]: functions in traits cannot be declared `async`
-  --> $DIR/fn-header-semantic-fail.rs:29:9
+  --> $DIR/fn-header-semantic-fail.rs:28:9
    |
 LL |         async fn ft1() {}
    |         -----^^^^^^^^^
@@ -176,7 +176,7 @@ LL |         async fn ft1() {}
    = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
 
 error[E0706]: functions in traits cannot be declared `async`
-  --> $DIR/fn-header-semantic-fail.rs:33:9
+  --> $DIR/fn-header-semantic-fail.rs:32:9
    |
 LL |         const async unsafe extern "C" fn ft5() {}
    |         ^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -188,115 +188,7 @@ LL |         const async unsafe extern "C" fn ft5() {}
    = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
    = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
 
-error[E0391]: cycle detected when computing type of `main::ff5::{opaque#0}`
-  --> $DIR/fn-header-semantic-fail.rs:12:44
-   |
-LL |     const async unsafe extern "C" fn ff5() {}
-   |                                            ^
-   |
-note: ...which requires borrow-checking `main::ff5`...
-  --> $DIR/fn-header-semantic-fail.rs:12:5
-   |
-LL |     const async unsafe extern "C" fn ff5() {}
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires processing MIR for `main::ff5`...
-  --> $DIR/fn-header-semantic-fail.rs:12:5
-   |
-LL |     const async unsafe extern "C" fn ff5() {}
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires const checking `main::ff5`...
-  --> $DIR/fn-header-semantic-fail.rs:12:5
-   |
-LL |     const async unsafe extern "C" fn ff5() {}
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   = note: ...which requires computing whether `main::ff5::{opaque#0}` is freeze...
-   = note: ...which requires evaluating trait selection obligation `main::ff5::{opaque#0}: core::marker::Freeze`...
-   = note: ...which again requires computing type of `main::ff5::{opaque#0}`, completing the cycle
-note: cycle used when checking item types in top-level module
-  --> $DIR/fn-header-semantic-fail.rs:5:1
-   |
-LL | / #![feature(const_extern_fn)]
-LL | |
-LL | | fn main() {
-LL | |     async fn ff1() {} // OK.
-...  |
-LL | |     }
-LL | | }
-   | |_^
-
-error[E0391]: cycle detected when computing type of `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 28:17>::ft5::{opaque#0}`
-  --> $DIR/fn-header-semantic-fail.rs:33:48
-   |
-LL |         const async unsafe extern "C" fn ft5() {}
-   |                                                ^
-   |
-note: ...which requires borrow-checking `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 28:17>::ft5`...
-  --> $DIR/fn-header-semantic-fail.rs:33:9
-   |
-LL |         const async unsafe extern "C" fn ft5() {}
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires processing MIR for `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 28:17>::ft5`...
-  --> $DIR/fn-header-semantic-fail.rs:33:9
-   |
-LL |         const async unsafe extern "C" fn ft5() {}
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires const checking `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 28:17>::ft5`...
-  --> $DIR/fn-header-semantic-fail.rs:33:9
-   |
-LL |         const async unsafe extern "C" fn ft5() {}
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   = note: ...which requires computing whether `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 28:17>::ft5::{opaque#0}` is freeze...
-   = note: ...which requires evaluating trait selection obligation `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 28:17>::ft5::{opaque#0}: core::marker::Freeze`...
-   = note: ...which again requires computing type of `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 28:17>::ft5::{opaque#0}`, completing the cycle
-note: cycle used when checking item types in top-level module
-  --> $DIR/fn-header-semantic-fail.rs:5:1
-   |
-LL | / #![feature(const_extern_fn)]
-LL | |
-LL | | fn main() {
-LL | |     async fn ff1() {} // OK.
-...  |
-LL | |     }
-LL | | }
-   | |_^
-
-error[E0391]: cycle detected when computing type of `main::<impl at $DIR/fn-header-semantic-fail.rs:40:5: 40:11>::fi5::{opaque#0}`
-  --> $DIR/fn-header-semantic-fail.rs:45:48
-   |
-LL |         const async unsafe extern "C" fn fi5() {}
-   |                                                ^
-   |
-note: ...which requires borrow-checking `main::<impl at $DIR/fn-header-semantic-fail.rs:40:5: 40:11>::fi5`...
-  --> $DIR/fn-header-semantic-fail.rs:45:9
-   |
-LL |         const async unsafe extern "C" fn fi5() {}
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires processing MIR for `main::<impl at $DIR/fn-header-semantic-fail.rs:40:5: 40:11>::fi5`...
-  --> $DIR/fn-header-semantic-fail.rs:45:9
-   |
-LL |         const async unsafe extern "C" fn fi5() {}
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-note: ...which requires const checking `main::<impl at $DIR/fn-header-semantic-fail.rs:40:5: 40:11>::fi5`...
-  --> $DIR/fn-header-semantic-fail.rs:45:9
-   |
-LL |         const async unsafe extern "C" fn fi5() {}
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   = note: ...which requires computing whether `main::<impl at $DIR/fn-header-semantic-fail.rs:40:5: 40:11>::fi5::{opaque#0}` is freeze...
-   = note: ...which requires evaluating trait selection obligation `main::<impl at $DIR/fn-header-semantic-fail.rs:40:5: 40:11>::fi5::{opaque#0}: core::marker::Freeze`...
-   = note: ...which again requires computing type of `main::<impl at $DIR/fn-header-semantic-fail.rs:40:5: 40:11>::fi5::{opaque#0}`, completing the cycle
-note: cycle used when checking item types in top-level module
-  --> $DIR/fn-header-semantic-fail.rs:5:1
-   |
-LL | / #![feature(const_extern_fn)]
-LL | |
-LL | | fn main() {
-LL | |     async fn ff1() {} // OK.
-...  |
-LL | |     }
-LL | | }
-   | |_^
-
-error: aborting due to 21 previous errors
+error: aborting due to 18 previous errors
 
-Some errors have detailed explanations: E0379, E0391, E0706.
+Some errors have detailed explanations: E0379, E0706.
 For more information about an error, try `rustc --explain E0379`.
diff --git a/tests/ui/suggestions/expected-boxed-future-isnt-pinned.stderr b/tests/ui/suggestions/expected-boxed-future-isnt-pinned.stderr
index 90ea0623952..b827beb504d 100644
--- a/tests/ui/suggestions/expected-boxed-future-isnt-pinned.stderr
+++ b/tests/ui/suggestions/expected-boxed-future-isnt-pinned.stderr
@@ -69,18 +69,15 @@ note: required by a bound in `Pin::<P>::new`
 error[E0308]: mismatched types
   --> $DIR/expected-boxed-future-isnt-pinned.rs:28:5
    |
+LL |   fn zap() -> BoxFuture<'static, i32> {
+   |               ----------------------- expected `Pin<Box<(dyn Future<Output = i32> + Send + 'static)>>` because of return type
 LL | /     async {
 LL | |         42
 LL | |     }
-   | |     ^
-   | |     |
-   | |_____expected `Pin<Box<...>>`, found `async` block
-   |       arguments to this function are incorrect
+   | |_____^ expected `Pin<Box<...>>`, found `async` block
    |
-   = note:     expected struct `Pin<Box<dyn Future<Output = i32> + Send>>`
+   = note:     expected struct `Pin<Box<(dyn Future<Output = i32> + Send + 'static)>>`
            found `async` block `[async block@$DIR/expected-boxed-future-isnt-pinned.rs:28:5: 30:6]`
-note: function defined here
-  --> $SRC_DIR/core/src/future/mod.rs:LL:COL
 help: you need to pin and box this expression
    |
 LL ~     Box::pin(async {