summaryrefslogtreecommitdiffstats
path: root/src/test/ui/parser/fn-header-semantic-fail.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/test/ui/parser/fn-header-semantic-fail.stderr
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/parser/fn-header-semantic-fail.stderr')
-rw-r--r--src/test/ui/parser/fn-header-semantic-fail.stderr330
1 files changed, 330 insertions, 0 deletions
diff --git a/src/test/ui/parser/fn-header-semantic-fail.stderr b/src/test/ui/parser/fn-header-semantic-fail.stderr
new file mode 100644
index 000000000..bc51ba8b8
--- /dev/null
+++ b/src/test/ui/parser/fn-header-semantic-fail.stderr
@@ -0,0 +1,330 @@
+error: functions cannot be both `const` and `async`
+ --> $DIR/fn-header-semantic-fail.rs:12:5
+ |
+LL | const async unsafe extern "C" fn ff5() {}
+ | ^^^^^-^^^^^------------------------------
+ | | |
+ | | `async` because of this
+ | `const` because of this
+
+error[E0706]: functions in traits cannot be declared `async`
+ --> $DIR/fn-header-semantic-fail.rs:17:9
+ |
+LL | async fn ft1();
+ | -----^^^^^^^^^^
+ | |
+ | `async` because of this
+ |
+ = note: `async` trait functions are not currently supported
+ = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
+
+error[E0379]: functions in traits cannot be declared const
+ --> $DIR/fn-header-semantic-fail.rs:19: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
+ |
+LL | const async unsafe extern "C" fn ft5();
+ | ^^^^^ functions in traits cannot be const
+
+error[E0706]: functions in traits cannot be declared `async`
+ --> $DIR/fn-header-semantic-fail.rs:21:9
+ |
+LL | const async unsafe extern "C" fn ft5();
+ | ^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | |
+ | `async` because of this
+ |
+ = note: `async` trait functions are not currently supported
+ = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
+
+error: functions cannot be both `const` and `async`
+ --> $DIR/fn-header-semantic-fail.rs:21:9
+ |
+LL | const async unsafe extern "C" fn ft5();
+ | ^^^^^-^^^^^----------------------------
+ | | |
+ | | `async` because of this
+ | `const` because of this
+
+error[E0706]: functions in traits cannot be declared `async`
+ --> $DIR/fn-header-semantic-fail.rs:29:9
+ |
+LL | async fn ft1() {}
+ | -----^^^^^^^^^^^^
+ | |
+ | `async` because of this
+ |
+ = note: `async` trait functions are not currently supported
+ = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
+
+error[E0379]: functions in traits cannot be declared const
+ --> $DIR/fn-header-semantic-fail.rs:32: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:34:9
+ |
+LL | const async unsafe extern "C" fn ft5() {}
+ | ^^^^^ functions in traits cannot be const
+
+error[E0706]: functions in traits cannot be declared `async`
+ --> $DIR/fn-header-semantic-fail.rs:34:9
+ |
+LL | const async unsafe extern "C" fn ft5() {}
+ | ^^^^^^-----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | |
+ | `async` because of this
+ |
+ = note: `async` trait functions are not currently supported
+ = note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
+
+error: functions cannot be both `const` and `async`
+ --> $DIR/fn-header-semantic-fail.rs:34:9
+ |
+LL | const async unsafe extern "C" fn ft5() {}
+ | ^^^^^-^^^^^------------------------------
+ | | |
+ | | `async` because of this
+ | `const` because of this
+
+error: functions cannot be both `const` and `async`
+ --> $DIR/fn-header-semantic-fail.rs:47:9
+ |
+LL | const async unsafe extern "C" fn fi5() {}
+ | ^^^^^-^^^^^------------------------------
+ | | |
+ | | `async` because of this
+ | `const` because of this
+
+error: functions in `extern` blocks cannot have qualifiers
+ --> $DIR/fn-header-semantic-fail.rs:53:18
+ |
+LL | extern "C" {
+ | ---------- in this `extern` block
+LL | async fn fe1();
+ | ^^^
+ |
+help: remove the qualifiers
+ |
+LL | fn fe1();
+ | ~~
+
+error: functions in `extern` blocks cannot have qualifiers
+ --> $DIR/fn-header-semantic-fail.rs:54:19
+ |
+LL | extern "C" {
+ | ---------- in this `extern` block
+LL | async fn fe1();
+LL | unsafe fn fe2();
+ | ^^^
+ |
+help: remove the qualifiers
+ |
+LL | fn fe2();
+ | ~~
+
+error: functions in `extern` blocks cannot have qualifiers
+ --> $DIR/fn-header-semantic-fail.rs:55:18
+ |
+LL | extern "C" {
+ | ---------- in this `extern` block
+...
+LL | const fn fe3();
+ | ^^^
+ |
+help: remove the qualifiers
+ |
+LL | fn fe3();
+ | ~~
+
+error: functions in `extern` blocks cannot have qualifiers
+ --> $DIR/fn-header-semantic-fail.rs:56:23
+ |
+LL | extern "C" {
+ | ---------- in this `extern` block
+...
+LL | extern "C" fn fe4();
+ | ^^^
+ |
+help: remove the qualifiers
+ |
+LL | fn fe4();
+ | ~~
+
+error: functions in `extern` blocks cannot have qualifiers
+ --> $DIR/fn-header-semantic-fail.rs:57:42
+ |
+LL | extern "C" {
+ | ---------- in this `extern` block
+...
+LL | const async unsafe extern "C" fn fe5();
+ | ^^^
+ |
+help: remove the qualifiers
+ |
+LL | fn fe5();
+ | ~~
+
+error: functions cannot be both `const` and `async`
+ --> $DIR/fn-header-semantic-fail.rs:57:9
+ |
+LL | const async unsafe extern "C" fn fe5();
+ | ^^^^^-^^^^^----------------------------
+ | | |
+ | | `async` because of this
+ | `const` because of this
+
+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 `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 `impl core::future::future::Future<Output = ()>` is freeze...
+ = note: ...which requires evaluating trait selection obligation `impl core::future::future::Future<Output = ()>: 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[E0053]: method `ft1` has an incompatible type for trait
+ --> $DIR/fn-header-semantic-fail.rs:29:24
+ |
+LL | async fn ft1() {}
+ | ^
+ | |
+ | checked the `Output` of this `async fn`, found opaque type
+ | expected `()`, found opaque type
+ |
+ = note: while checking the return type of the `async fn`
+note: type in trait
+ --> $DIR/fn-header-semantic-fail.rs:17:23
+ |
+LL | async fn ft1();
+ | ^
+ = note: expected fn pointer `fn()`
+ found fn pointer `fn() -> impl Future<Output = ()>`
+
+error[E0053]: method `ft5` has an incompatible type for trait
+ --> $DIR/fn-header-semantic-fail.rs:34:48
+ |
+LL | const async unsafe extern "C" fn ft5() {}
+ | ^
+ | |
+ | checked the `Output` of this `async fn`, found opaque type
+ | expected `()`, found opaque type
+ |
+ = note: while checking the return type of the `async fn`
+note: type in trait
+ --> $DIR/fn-header-semantic-fail.rs:21:47
+ |
+LL | const async unsafe extern "C" fn ft5();
+ | ^
+ = note: expected fn pointer `unsafe extern "C" fn()`
+ found fn pointer `unsafe extern "C" fn() -> impl Future<Output = ()>`
+
+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:34: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:34:9
+ |
+LL | const async unsafe extern "C" fn ft5() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires processing `main::<impl at $DIR/fn-header-semantic-fail.rs:28:5: 28:17>::ft5`...
+ --> $DIR/fn-header-semantic-fail.rs:34: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:34:9
+ |
+LL | const async unsafe extern "C" fn ft5() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: ...which requires computing whether `impl core::future::future::Future<Output = ()>` is freeze...
+ = note: ...which requires evaluating trait selection obligation `impl core::future::future::Future<Output = ()>: 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:42:5: 42:11>::fi5::{opaque#0}`
+ --> $DIR/fn-header-semantic-fail.rs:47:48
+ |
+LL | const async unsafe extern "C" fn fi5() {}
+ | ^
+ |
+note: ...which requires borrow-checking `main::<impl at $DIR/fn-header-semantic-fail.rs:42:5: 42:11>::fi5`...
+ --> $DIR/fn-header-semantic-fail.rs:47:9
+ |
+LL | const async unsafe extern "C" fn fi5() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires processing `main::<impl at $DIR/fn-header-semantic-fail.rs:42:5: 42:11>::fi5`...
+ --> $DIR/fn-header-semantic-fail.rs:47:9
+ |
+LL | const async unsafe extern "C" fn fi5() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires const checking `main::<impl at $DIR/fn-header-semantic-fail.rs:42:5: 42:11>::fi5`...
+ --> $DIR/fn-header-semantic-fail.rs:47:9
+ |
+LL | const async unsafe extern "C" fn fi5() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ = note: ...which requires computing whether `impl core::future::future::Future<Output = ()>` is freeze...
+ = note: ...which requires evaluating trait selection obligation `impl core::future::future::Future<Output = ()>: core::marker::Freeze`...
+ = note: ...which again requires computing type of `main::<impl at $DIR/fn-header-semantic-fail.rs:42:5: 42: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 23 previous errors
+
+Some errors have detailed explanations: E0053, E0379, E0391, E0706.
+For more information about an error, try `rustc --explain E0053`.