diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/codegen/force-frame-pointers.rs | 16 | ||||
| -rw-r--r-- | tests/run-make/branch-protection-check-IBT/Makefile | 6 | ||||
| -rw-r--r-- | tests/run-make/branch-protection-check-IBT/_rmake.rs | 31 | ||||
| -rw-r--r-- | tests/run-make/relro-levels/Makefile | 22 | ||||
| -rw-r--r-- | tests/run-make/relro-levels/rmake.rs | 28 | ||||
| -rw-r--r-- | tests/run-make/static-pie/Makefile | 18 | ||||
| -rwxr-xr-x | tests/run-make/static-pie/check_clang_version.sh | 20 | ||||
| -rwxr-xr-x | tests/run-make/static-pie/check_gcc_version.sh | 20 | ||||
| -rw-r--r-- | tests/run-make/static-pie/rmake.rs | 73 | ||||
| -rw-r--r-- | tests/ui/abi/variadic-ffi.rs | 8 | ||||
| -rw-r--r-- | tests/ui/c-variadic/issue-86053-1.stderr | 2 | ||||
| -rw-r--r-- | tests/ui/mir/issue-83499-input-output-iteration-ice.rs | 2 | ||||
| -rw-r--r-- | tests/ui/mir/issue-83499-input-output-iteration-ice.stderr | 2 | ||||
| -rw-r--r-- | tests/ui/parser/variadic-ffi-semantic-restrictions.rs | 42 | ||||
| -rw-r--r-- | tests/ui/parser/variadic-ffi-semantic-restrictions.stderr | 42 |
15 files changed, 205 insertions, 127 deletions
diff --git a/tests/codegen/force-frame-pointers.rs b/tests/codegen/force-frame-pointers.rs index 84e0bcb39ad..88c918945d6 100644 --- a/tests/codegen/force-frame-pointers.rs +++ b/tests/codegen/force-frame-pointers.rs @@ -1,6 +1,18 @@ -//@ compile-flags: -C no-prepopulate-passes -C force-frame-pointers=y -Copt-level=0 +//@ revisions: Always NonLeaf +//@ [Always] compile-flags: -Cforce-frame-pointers=yes +//@ [NonLeaf] compile-flags: -Cforce-frame-pointers=non-leaf +//@ compile-flags: -Zunstable-options +//@ compile-flags: -C no-prepopulate-passes -Copt-level=0 +//@ [NonLeaf] ignore-illumos +//@ [NonLeaf] ignore-openbsd +//@ [NonLeaf] ignore-x86 +//@ [NonLeaf] ignore-x86_64-apple-darwin +//@ [NonLeaf] ignore-windows-gnu +//@ [NonLeaf] ignore-thumb +// result is platform-dependent based on platform's frame pointer settings #![crate_type = "lib"] -// CHECK: attributes #{{.*}} "frame-pointer"="all" +// Always: attributes #{{.*}} "frame-pointer"="all" +// NonLeaf: attributes #{{.*}} "frame-pointer"="non-leaf" pub fn foo() {} diff --git a/tests/run-make/branch-protection-check-IBT/Makefile b/tests/run-make/branch-protection-check-IBT/Makefile index cabe951e1c5..ee0e034627f 100644 --- a/tests/run-make/branch-protection-check-IBT/Makefile +++ b/tests/run-make/branch-protection-check-IBT/Makefile @@ -7,6 +7,12 @@ include ../tools.mk # only-x86_64 +# ignore-test +# FIXME(jieyouxu): This test never runs because the `ifeq` check on line 17 +# compares `x86` to `x86_64`, which always evaluates to false. +# When the test does run, the compilation does not include `.note.gnu.property`. +# See https://github.com/rust-lang/rust/pull/126720 for more information. + all: ifeq ($(filter x86,$(LLVM_COMPONENTS)),x86_64) $(RUSTC) --target x86_64-unknown-linux-gnu -Z cf-protection=branch -L$(TMPDIR) -C link-args='-nostartfiles' -C save-temps ./main.rs -o $(TMPDIR)/rsmain diff --git a/tests/run-make/branch-protection-check-IBT/_rmake.rs b/tests/run-make/branch-protection-check-IBT/_rmake.rs new file mode 100644 index 00000000000..d66ecf9c005 --- /dev/null +++ b/tests/run-make/branch-protection-check-IBT/_rmake.rs @@ -0,0 +1,31 @@ +// Check for GNU Property Note + +// How to run this +// python3 x.py test --target x86_64-unknown-linux-gnu tests/run-make/branch-protection-check-IBT/ + +//@ only-x86_64 + +//@ ignore-test +// FIXME(jieyouxu): see the FIXME in the Makefile + +use run_make_support::llvm_readobj; +use run_make_support::rustc; +use run_make_support::{cwd, env_var}; + +fn main() { + let llvm_components = env_var("LLVM_COMPONENTS"); + if !format!(" {llvm_components} ").contains(" x86 ") { + return; + } + + rustc() + .input("main.rs") + .target("x86_64-unknown-linux-gnu") + .arg("-Zcf-protection=branch") + .arg(format!("-L{}", cwd().display())) + .arg("-Clink-args=-nostartfiles") + .arg("-Csave-temps") + .run(); + + llvm_readobj().arg("-nW").input("main").run().assert_stdout_contains(".note.gnu.property"); +} diff --git a/tests/run-make/relro-levels/Makefile b/tests/run-make/relro-levels/Makefile deleted file mode 100644 index 94f08bcb494..00000000000 --- a/tests/run-make/relro-levels/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -# ignore-cross-compile -include ../tools.mk - -# only-linux -# -# This tests the different -Crelro-level values, and makes sure that they work properly. - -all: - # Ensure that binaries built with the full relro level links them with both - # RELRO and BIND_NOW for doing eager symbol resolving. - $(RUSTC) -Crelro-level=full hello.rs - readelf -l $(TMPDIR)/hello | grep -q GNU_RELRO - readelf -d $(TMPDIR)/hello | grep -q BIND_NOW - - $(RUSTC) -Crelro-level=partial hello.rs - readelf -l $(TMPDIR)/hello | grep -q GNU_RELRO - - # Ensure that we're *not* built with RELRO when setting it to off. We do - # not want to check for BIND_NOW however, as the linker might have that - # enabled by default. - $(RUSTC) -Crelro-level=off hello.rs - ! readelf -l $(TMPDIR)/hello | grep -q GNU_RELRO diff --git a/tests/run-make/relro-levels/rmake.rs b/tests/run-make/relro-levels/rmake.rs new file mode 100644 index 00000000000..56545ebc5aa --- /dev/null +++ b/tests/run-make/relro-levels/rmake.rs @@ -0,0 +1,28 @@ +// This tests the different -Crelro-level values, and makes sure that they work properly. + +//@ only-linux + +use run_make_support::llvm_readobj; +use run_make_support::rustc; + +fn compile(relro_level: &str) { + rustc().arg(format!("-Crelro-level={relro_level}")).input("hello.rs").run(); +} + +fn main() { + // Ensure that binaries built with the full relro level links them with both + // RELRO and BIND_NOW for doing eager symbol resolving. + + compile("full"); + llvm_readobj().program_headers().input("hello").run().assert_stdout_contains("GNU_RELRO"); + llvm_readobj().dynamic_table().input("hello").run().assert_stdout_contains("BIND_NOW"); + + compile("partial"); + llvm_readobj().program_headers().input("hello").run().assert_stdout_contains("GNU_RELRO"); + + // Ensure that we're *not* built with RELRO when setting it to off. We do + // not want to check for BIND_NOW however, as the linker might have that + // enabled by default. + compile("off"); + llvm_readobj().program_headers().input("hello").run().assert_stdout_not_contains("GNU_RELRO"); +} diff --git a/tests/run-make/static-pie/Makefile b/tests/run-make/static-pie/Makefile deleted file mode 100644 index 8379730cc3d..00000000000 --- a/tests/run-make/static-pie/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -include ../tools.mk - -# only-x86_64 -# only-linux -# ignore-32bit - -# How to manually run this -# $ ./x.py test --target x86_64-unknown-linux-[musl,gnu] tests/run-make/static-pie - -all: test-clang test-gcc - -test-%: - if ./check_$*_version.sh; then\ - ${RUSTC} -Clinker=$* -Clinker-flavor=gcc --target ${TARGET} -C target-feature=+crt-static test-aslr.rs; \ - ! readelf -l $(call RUN_BINFILE,test-aslr) | $(CGREP) INTERP; \ - readelf -l $(call RUN_BINFILE,test-aslr) | $(CGREP) DYNAMIC; \ - $(call RUN,test-aslr) --test-aslr; \ - fi diff --git a/tests/run-make/static-pie/check_clang_version.sh b/tests/run-make/static-pie/check_clang_version.sh deleted file mode 100755 index b8e97c3da7d..00000000000 --- a/tests/run-make/static-pie/check_clang_version.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -if command -v clang > /dev/null -then - CLANG_VERSION=$(echo __clang_major__ | clang -E -x c - | grep -v -e '^#' ) - echo "clang version $CLANG_VERSION detected" - if (( $CLANG_VERSION >= 9 )) - then - echo "clang supports -static-pie" - exit 0 - else - echo "clang too old to support -static-pie, skipping test" - exit 1 - fi -else - echo "No clang version detected" - exit 2 -fi diff --git a/tests/run-make/static-pie/check_gcc_version.sh b/tests/run-make/static-pie/check_gcc_version.sh deleted file mode 100755 index d07e1d151df..00000000000 --- a/tests/run-make/static-pie/check_gcc_version.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -set -euo pipefail - -if command -v gcc > /dev/null -then - GCC_VERSION=$(echo __GNUC__ | gcc -E -x c - | grep -v -e '^#' ) - echo "gcc version $GCC_VERSION detected" - if (( $GCC_VERSION >= 8 )) - then - echo "gcc supports -static-pie" - exit 0 - else - echo "gcc too old to support -static-pie, skipping test" - exit 1 - fi -else - echo "No gcc version detected" - exit 2 -fi diff --git a/tests/run-make/static-pie/rmake.rs b/tests/run-make/static-pie/rmake.rs new file mode 100644 index 00000000000..77c5e253bc0 --- /dev/null +++ b/tests/run-make/static-pie/rmake.rs @@ -0,0 +1,73 @@ +// How to manually run this +// $ ./x.py test --target x86_64-unknown-linux-[musl,gnu] tests/run-make/static-pie + +//@ only-x86_64 +//@ only-linux +//@ ignore-32bit + +use std::process::Command; + +use run_make_support::llvm_readobj; +use run_make_support::regex::Regex; +use run_make_support::rustc; +use run_make_support::{cmd, run_with_args, target}; + +// Minimum major versions supporting -static-pie +const GCC_VERSION: u32 = 8; +const CLANG_VERSION: u32 = 9; + +// Return `true` if the `compiler` version supports `-static-pie`. +fn ok_compiler_version(compiler: &str) -> bool { + let (trigger, version_threshold) = match compiler { + "clang" => ("__clang_major__", CLANG_VERSION), + "gcc" => ("__GNUC__", GCC_VERSION), + other => panic!("unexpected compiler '{other}', expected 'clang' or 'gcc'"), + }; + + if Command::new(compiler).spawn().is_err() { + eprintln!("No {compiler} version detected"); + return false; + } + + let compiler_output = + cmd(compiler).stdin(trigger).arg("-").arg("-E").arg("-x").arg("c").run().stdout_utf8(); + let re = Regex::new(r"(?m)^(\d+)").unwrap(); + let version: u32 = + re.captures(&compiler_output).unwrap().get(1).unwrap().as_str().parse().unwrap(); + + if version >= version_threshold { + eprintln!("{compiler} supports -static-pie"); + true + } else { + eprintln!("{compiler} too old to support -static-pie, skipping test"); + false + } +} + +fn test(compiler: &str) { + if !ok_compiler_version(compiler) { + return; + } + + rustc() + .input("test-aslr.rs") + .target(&target()) + .linker(compiler) + .arg("-Clinker-flavor=gcc") + .arg("-Ctarget-feature=+crt-static") + .run(); + + llvm_readobj() + .symbols() + .input("test-aslr") + .run() + .assert_stdout_not_contains("INTERP") + .assert_stdout_contains("DYNAMIC"); + + run_with_args("test-aslr", &["--test-aslr"]); +} + +fn main() { + test("clang"); + test("gcc"); +} diff --git a/tests/ui/abi/variadic-ffi.rs b/tests/ui/abi/variadic-ffi.rs index de4844ac860..6cfae0f2a32 100644 --- a/tests/ui/abi/variadic-ffi.rs +++ b/tests/ui/abi/variadic-ffi.rs @@ -14,6 +14,10 @@ pub unsafe extern "C" fn test_valist_forward(n: u64, mut ap: ...) -> f64 { rust_valist_interesting_average(n, ap.as_va_list()) } +pub unsafe extern "C-unwind" fn c_unwind_can_forward(n: u64, mut ap: ...) -> f64 { + rust_valist_interesting_average(n, ap.as_va_list()) +} + pub unsafe extern "C" fn test_va_copy(_: u64, mut ap: ...) { let mut ap2 = ap.clone(); assert_eq!(rust_valist_interesting_average(2, ap2.as_va_list()) as i64, 30); @@ -73,6 +77,10 @@ pub fn main() { } unsafe { + assert_eq!(c_unwind_can_forward(2, 10i64, 10f64, 20i64, 20f64) as i64, 30); + } + + unsafe { test_va_copy(4, 10i64, 10f64, 20i64, 20f64, 30i64, 30f64, 40i64, 40f64); } } diff --git a/tests/ui/c-variadic/issue-86053-1.stderr b/tests/ui/c-variadic/issue-86053-1.stderr index 69e19e1d4d2..67a619e46d5 100644 --- a/tests/ui/c-variadic/issue-86053-1.stderr +++ b/tests/ui/c-variadic/issue-86053-1.stderr @@ -46,7 +46,7 @@ error: `...` must be the last argument of a C-variadic function LL | self , ... , self , self , ... ) where F : FnOnce ( & 'a & 'b usize ) { | ^^^ -error: only foreign or `unsafe extern "C"` functions may be C-variadic +error: only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg --> $DIR/issue-86053-1.rs:11:12 | LL | self , ... , self , self , ... ) where F : FnOnce ( & 'a & 'b usize ) { diff --git a/tests/ui/mir/issue-83499-input-output-iteration-ice.rs b/tests/ui/mir/issue-83499-input-output-iteration-ice.rs index 0086d2ec18c..78e5c961802 100644 --- a/tests/ui/mir/issue-83499-input-output-iteration-ice.rs +++ b/tests/ui/mir/issue-83499-input-output-iteration-ice.rs @@ -5,6 +5,6 @@ fn main() {} fn foo(_: Bar, ...) -> impl {} -//~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic +//~^ ERROR only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg //~| ERROR cannot find type `Bar` in this scope //~| ERROR at least one trait must be specified diff --git a/tests/ui/mir/issue-83499-input-output-iteration-ice.stderr b/tests/ui/mir/issue-83499-input-output-iteration-ice.stderr index 4eb3adc8b4f..80a8a94aea4 100644 --- a/tests/ui/mir/issue-83499-input-output-iteration-ice.stderr +++ b/tests/ui/mir/issue-83499-input-output-iteration-ice.stderr @@ -1,4 +1,4 @@ -error: only foreign or `unsafe extern "C"` functions may be C-variadic +error: only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg --> $DIR/issue-83499-input-output-iteration-ice.rs:7:16 | LL | fn foo(_: Bar, ...) -> impl {} diff --git a/tests/ui/parser/variadic-ffi-semantic-restrictions.rs b/tests/ui/parser/variadic-ffi-semantic-restrictions.rs index 11126dbc65d..1cd6d13d56b 100644 --- a/tests/ui/parser/variadic-ffi-semantic-restrictions.rs +++ b/tests/ui/parser/variadic-ffi-semantic-restrictions.rs @@ -4,29 +4,29 @@ fn main() {} fn f1_1(x: isize, ...) {} -//~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic +//~^ ERROR only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg fn f1_2(...) {} -//~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic +//~^ ERROR only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg extern "C" fn f2_1(x: isize, ...) {} -//~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic +//~^ ERROR only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg extern "C" fn f2_2(...) {} -//~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic +//~^ ERROR only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg extern "C" fn f2_3(..., x: isize) {} -//~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic +//~^ ERROR only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg //~| ERROR `...` must be the last argument of a C-variadic function extern "C" fn f3_1(x: isize, ...) {} -//~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic +//~^ ERROR only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg extern "C" fn f3_2(...) {} -//~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic +//~^ ERROR only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg extern "C" fn f3_3(..., x: isize) {} -//~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic +//~^ ERROR only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg //~| ERROR `...` must be the last argument of a C-variadic function const unsafe extern "C" fn f4_1(x: isize, ...) {} @@ -35,12 +35,12 @@ const unsafe extern "C" fn f4_1(x: isize, ...) {} const extern "C" fn f4_2(x: isize, ...) {} //~^ ERROR functions cannot be both `const` and C-variadic -//~| ERROR only foreign or `unsafe extern "C"` functions may be C-variadic +//~| ERROR only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg //~| ERROR destructor of `VaListImpl<'_>` cannot be evaluated at compile-time const extern "C" fn f4_3(..., x: isize, ...) {} //~^ ERROR functions cannot be both `const` and C-variadic -//~| ERROR only foreign or `unsafe extern "C"` functions may be C-variadic +//~| ERROR only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg //~| ERROR `...` must be the last argument of a C-variadic function extern "C" { @@ -52,34 +52,34 @@ struct X; impl X { fn i_f1(x: isize, ...) {} - //~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic + //~^ ERROR only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg fn i_f2(...) {} - //~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic + //~^ ERROR only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg fn i_f3(..., x: isize, ...) {} - //~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic + //~^ ERROR only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg //~| ERROR `...` must be the last argument of a C-variadic function fn i_f4(..., x: isize, ...) {} - //~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic + //~^ ERROR only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg //~| ERROR `...` must be the last argument of a C-variadic function const fn i_f5(x: isize, ...) {} - //~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic + //~^ ERROR only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg //~| ERROR functions cannot be both `const` and C-variadic //~| ERROR destructor of `VaListImpl<'_>` cannot be evaluated at compile-time } trait T { fn t_f1(x: isize, ...) {} - //~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic + //~^ ERROR only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg fn t_f2(x: isize, ...); - //~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic + //~^ ERROR only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg fn t_f3(...) {} - //~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic + //~^ ERROR only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg fn t_f4(...); - //~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic + //~^ ERROR only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg fn t_f5(..., x: isize) {} - //~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic + //~^ ERROR only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg //~| ERROR `...` must be the last argument of a C-variadic function fn t_f6(..., x: isize); - //~^ ERROR only foreign or `unsafe extern "C"` functions may be C-variadic + //~^ ERROR only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg //~| ERROR `...` must be the last argument of a C-variadic function } diff --git a/tests/ui/parser/variadic-ffi-semantic-restrictions.stderr b/tests/ui/parser/variadic-ffi-semantic-restrictions.stderr index f71e3863440..b740cef0200 100644 --- a/tests/ui/parser/variadic-ffi-semantic-restrictions.stderr +++ b/tests/ui/parser/variadic-ffi-semantic-restrictions.stderr @@ -1,22 +1,22 @@ -error: only foreign or `unsafe extern "C"` functions may be C-variadic +error: only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg --> $DIR/variadic-ffi-semantic-restrictions.rs:6:19 | LL | fn f1_1(x: isize, ...) {} | ^^^ -error: only foreign or `unsafe extern "C"` functions may be C-variadic +error: only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg --> $DIR/variadic-ffi-semantic-restrictions.rs:9:9 | LL | fn f1_2(...) {} | ^^^ -error: only foreign or `unsafe extern "C"` functions may be C-variadic +error: only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg --> $DIR/variadic-ffi-semantic-restrictions.rs:12:30 | LL | extern "C" fn f2_1(x: isize, ...) {} | ^^^ -error: only foreign or `unsafe extern "C"` functions may be C-variadic +error: only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg --> $DIR/variadic-ffi-semantic-restrictions.rs:15:20 | LL | extern "C" fn f2_2(...) {} @@ -28,19 +28,19 @@ error: `...` must be the last argument of a C-variadic function LL | extern "C" fn f2_3(..., x: isize) {} | ^^^ -error: only foreign or `unsafe extern "C"` functions may be C-variadic +error: only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg --> $DIR/variadic-ffi-semantic-restrictions.rs:18:20 | LL | extern "C" fn f2_3(..., x: isize) {} | ^^^ -error: only foreign or `unsafe extern "C"` functions may be C-variadic +error: only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg --> $DIR/variadic-ffi-semantic-restrictions.rs:22:30 | LL | extern "C" fn f3_1(x: isize, ...) {} | ^^^ -error: only foreign or `unsafe extern "C"` functions may be C-variadic +error: only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg --> $DIR/variadic-ffi-semantic-restrictions.rs:25:20 | LL | extern "C" fn f3_2(...) {} @@ -52,7 +52,7 @@ error: `...` must be the last argument of a C-variadic function LL | extern "C" fn f3_3(..., x: isize) {} | ^^^ -error: only foreign or `unsafe extern "C"` functions may be C-variadic +error: only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg --> $DIR/variadic-ffi-semantic-restrictions.rs:28:20 | LL | extern "C" fn f3_3(..., x: isize) {} @@ -70,7 +70,7 @@ error: functions cannot be both `const` and C-variadic LL | const extern "C" fn f4_2(x: isize, ...) {} | ^^^^^ `const` because of this ^^^ C-variadic because of this -error: only foreign or `unsafe extern "C"` functions may be C-variadic +error: only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg --> $DIR/variadic-ffi-semantic-restrictions.rs:36:36 | LL | const extern "C" fn f4_2(x: isize, ...) {} @@ -91,7 +91,7 @@ LL | const extern "C" fn f4_3(..., x: isize, ...) {} | | C-variadic because of this | `const` because of this -error: only foreign or `unsafe extern "C"` functions may be C-variadic +error: only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg --> $DIR/variadic-ffi-semantic-restrictions.rs:41:26 | LL | const extern "C" fn f4_3(..., x: isize, ...) {} @@ -103,13 +103,13 @@ error: `...` must be the last argument of a C-variadic function LL | fn e_f2(..., x: isize); | ^^^ -error: only foreign or `unsafe extern "C"` functions may be C-variadic +error: only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg --> $DIR/variadic-ffi-semantic-restrictions.rs:54:23 | LL | fn i_f1(x: isize, ...) {} | ^^^ -error: only foreign or `unsafe extern "C"` functions may be C-variadic +error: only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg --> $DIR/variadic-ffi-semantic-restrictions.rs:56:13 | LL | fn i_f2(...) {} @@ -121,7 +121,7 @@ error: `...` must be the last argument of a C-variadic function LL | fn i_f3(..., x: isize, ...) {} | ^^^ -error: only foreign or `unsafe extern "C"` functions may be C-variadic +error: only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg --> $DIR/variadic-ffi-semantic-restrictions.rs:58:13 | LL | fn i_f3(..., x: isize, ...) {} @@ -133,7 +133,7 @@ error: `...` must be the last argument of a C-variadic function LL | fn i_f4(..., x: isize, ...) {} | ^^^ -error: only foreign or `unsafe extern "C"` functions may be C-variadic +error: only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg --> $DIR/variadic-ffi-semantic-restrictions.rs:61:13 | LL | fn i_f4(..., x: isize, ...) {} @@ -147,31 +147,31 @@ LL | const fn i_f5(x: isize, ...) {} | | | `const` because of this -error: only foreign or `unsafe extern "C"` functions may be C-variadic +error: only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg --> $DIR/variadic-ffi-semantic-restrictions.rs:64:29 | LL | const fn i_f5(x: isize, ...) {} | ^^^ -error: only foreign or `unsafe extern "C"` functions may be C-variadic +error: only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg --> $DIR/variadic-ffi-semantic-restrictions.rs:71:23 | LL | fn t_f1(x: isize, ...) {} | ^^^ -error: only foreign or `unsafe extern "C"` functions may be C-variadic +error: only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg --> $DIR/variadic-ffi-semantic-restrictions.rs:73:23 | LL | fn t_f2(x: isize, ...); | ^^^ -error: only foreign or `unsafe extern "C"` functions may be C-variadic +error: only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg --> $DIR/variadic-ffi-semantic-restrictions.rs:75:13 | LL | fn t_f3(...) {} | ^^^ -error: only foreign or `unsafe extern "C"` functions may be C-variadic +error: only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg --> $DIR/variadic-ffi-semantic-restrictions.rs:77:13 | LL | fn t_f4(...); @@ -183,7 +183,7 @@ error: `...` must be the last argument of a C-variadic function LL | fn t_f5(..., x: isize) {} | ^^^ -error: only foreign or `unsafe extern "C"` functions may be C-variadic +error: only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg --> $DIR/variadic-ffi-semantic-restrictions.rs:79:13 | LL | fn t_f5(..., x: isize) {} @@ -195,7 +195,7 @@ error: `...` must be the last argument of a C-variadic function LL | fn t_f6(..., x: isize); | ^^^ -error: only foreign or `unsafe extern "C"` functions may be C-variadic +error: only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg --> $DIR/variadic-ffi-semantic-restrictions.rs:82:13 | LL | fn t_f6(..., x: isize); |
