summaryrefslogtreecommitdiffstats
path: root/src/test/ui/parser/fn-header-semantic-fail.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
commit64d98f8ee037282c35007b64c2649055c56af1db (patch)
tree5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /src/test/ui/parser/fn-header-semantic-fail.rs
parentAdding debian version 1.67.1+dfsg1-1. (diff)
downloadrustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz
rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/parser/fn-header-semantic-fail.rs')
-rw-r--r--src/test/ui/parser/fn-header-semantic-fail.rs58
1 files changed, 0 insertions, 58 deletions
diff --git a/src/test/ui/parser/fn-header-semantic-fail.rs b/src/test/ui/parser/fn-header-semantic-fail.rs
deleted file mode 100644
index cf5d3dab4..000000000
--- a/src/test/ui/parser/fn-header-semantic-fail.rs
+++ /dev/null
@@ -1,58 +0,0 @@
-// Ensures that all `fn` forms can have all the function qualifiers syntactically.
-
-// edition:2018
-
-#![feature(const_extern_fn)]
-
-fn main() {
- async fn ff1() {} // OK.
- unsafe fn ff2() {} // OK.
- const fn ff3() {} // OK.
- 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`
- unsafe fn ft2(); // OK.
- const fn ft3(); //~ ERROR functions in traits cannot be declared const
- extern "C" fn ft4(); // OK.
- const async unsafe extern "C" fn ft5();
- //~^ ERROR functions in traits cannot be declared `async`
- //~| ERROR functions in traits cannot be declared const
- //~| ERROR functions cannot be both `const` and `async`
- }
-
- struct Y;
- impl X for Y {
- async fn ft1() {} //~ ERROR functions in traits cannot be declared `async`
- unsafe fn ft2() {} // OK.
- const fn ft3() {} //~ ERROR functions in traits cannot be declared const
- extern "C" fn ft4() {}
- const async unsafe extern "C" fn ft5() {}
- //~^ 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 {
- async fn fi1() {} // OK.
- unsafe fn fi2() {} // OK.
- const fn fi3() {} // OK.
- 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" {
- async fn fe1(); //~ ERROR functions in `extern` blocks cannot have qualifiers
- unsafe fn fe2(); //~ ERROR functions in `extern` blocks cannot have qualifiers
- const fn fe3(); //~ ERROR functions in `extern` blocks cannot have qualifiers
- extern "C" fn fe4(); //~ ERROR functions in `extern` blocks cannot have qualifiers
- const async unsafe extern "C" fn fe5(); //~ ERROR functions in `extern` blocks
- //~^ ERROR functions cannot be both `const` and `async`
- }
-}