From 5edeb594e89ccbb3d21e2c9465b4d8cf98918f6a Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Fri, 13 Feb 2026 18:37:39 +0100 Subject: [PATCH] Stabilize `c_variadic` --- compiler/rustc_ast_passes/src/feature_gate.rs | 8 +- compiler/rustc_feature/src/accepted.rs | 2 + compiler/rustc_feature/src/unstable.rs | 2 - library/core/src/ffi/mod.rs | 14 +- library/core/src/ffi/va_list.rs | 21 ++- library/core/src/intrinsics/mod.rs | 2 +- library/std/src/ffi/mod.rs | 7 +- library/std/src/lib.rs | 1 - .../src/language-features/c-variadic.md | 24 --- .../tests/fail/c-variadic-mismatch-count.rs | 2 - .../miri/tests/fail/c-variadic-mismatch.rs | 2 - src/tools/miri/tests/fail/c-variadic.rs | 2 - .../tests/pass/c-variadic-ignored-argument.rs | 1 - src/tools/miri/tests/pass/c-variadic.rs | 2 - tests/assembly-llvm/c-variadic/arm.rs | 1 - tests/assembly-llvm/c-variadic/mips.rs | 2 +- tests/assembly-llvm/c-variadic/sparc.rs | 2 +- tests/codegen-llvm/c-variadic-lifetime.rs | 1 - tests/codegen-llvm/cffi/c-variadic-inline.rs | 1 - tests/codegen-llvm/cffi/c-variadic-naked.rs | 1 - tests/codegen-llvm/cffi/c-variadic-opt.rs | 1 - tests/codegen-llvm/cffi/c-variadic-va_list.rs | 1 - tests/codegen-llvm/cffi/c-variadic.rs | 1 - tests/mir-opt/inline/inline_compatibility.rs | 1 - tests/pretty/fn-variadic.rs | 1 - tests/pretty/hir-fn-variadic.pp | 2 - tests/pretty/hir-fn-variadic.rs | 2 - .../c-link-to-rust-va-list-fn/checkrust.rs | 1 - tests/ui-fulldeps/rustc_public/check_abi.rs | 1 - tests/ui/abi/variadic-ffi.rs | 2 - tests/ui/c-variadic/copy.rs | 1 - tests/ui/c-variadic/inherent-method.rs | 2 - tests/ui/c-variadic/issue-86053-1.rs | 1 - tests/ui/c-variadic/issue-86053-1.stderr | 20 +-- tests/ui/c-variadic/issue-86053-2.rs | 2 - tests/ui/c-variadic/issue-86053-2.stderr | 4 +- tests/ui/c-variadic/naked-invalid.rs | 2 +- tests/ui/c-variadic/naked.rs | 2 +- tests/ui/c-variadic/no-closure.rs | 1 - tests/ui/c-variadic/no-closure.stderr | 6 +- tests/ui/c-variadic/not-async.rs | 1 - tests/ui/c-variadic/not-async.stderr | 8 +- tests/ui/c-variadic/not-dyn-compatible.rs | 1 - tests/ui/c-variadic/not-dyn-compatible.stderr | 4 +- tests/ui/c-variadic/pass-by-value-abi.rs | 2 +- tests/ui/c-variadic/roundtrip.rs | 2 +- .../same-program-multiple-abis-arm.rs | 4 +- .../same-program-multiple-abis-x86_64.rs | 4 +- tests/ui/c-variadic/trait-method.rs | 1 - tests/ui/c-variadic/unsupported-abi.rs | 2 +- tests/ui/c-variadic/valid.rs | 1 - tests/ui/c-variadic/variadic-ffi-4.rs | 1 - tests/ui/c-variadic/variadic-ffi-4.stderr | 14 +- tests/ui/c-variadic/variadic-ffi-6.rs | 12 +- tests/ui/c-variadic/variadic-ffi-6.stderr | 18 +- .../variadic-unreachable-arg-error.rs | 2 - .../cmse-nonsecure-entry/c-variadic.rs | 2 +- tests/ui/consts/const-eval/c-variadic-fail.rs | 1 - .../consts/const-eval/c-variadic-fail.stderr | 92 +++++----- .../const-eval/c-variadic-ignored-argument.rs | 1 - tests/ui/consts/const-eval/c-variadic.rs | 1 - .../ui/delegation/auxiliary/fn-header-aux.rs | 2 - tests/ui/delegation/fn-header-variadic.rs | 1 - tests/ui/delegation/fn-header-variadic.stderr | 6 +- tests/ui/delegation/fn-header.rs | 1 - .../ui/delegation/unsupported.current.stderr | 24 +-- tests/ui/delegation/unsupported.next.stderr | 16 +- tests/ui/delegation/unsupported.rs | 1 - tests/ui/explicit-tail-calls/c-variadic.rs | 2 +- .../explicit-tail-calls/signature-mismatch.rs | 5 - .../signature-mismatch.stderr | 8 +- ...feature-gate-c_variadic-naked-functions.rs | 2 +- .../feature-gates/feature-gate-c_variadic.rs | 9 - .../feature-gate-c_variadic.stderr | 23 --- .../feature-gate-const-c-variadic.rs | 2 - .../feature-gate-const-c-variadic.stderr | 4 +- tests/ui/force-inlining/early-deny.rs | 10 +- tests/ui/force-inlining/early-deny.stderr | 12 +- .../note-and-explain-ReVar-124973.rs | 2 - .../note-and-explain-ReVar-124973.stderr | 4 +- tests/ui/lint/function-item-references.rs | 3 +- tests/ui/lint/function-item-references.stderr | 68 ++++---- .../issue-83499-input-output-iteration-ice.rs | 2 - ...ue-83499-input-output-iteration-ice.stderr | 4 +- .../mismatch-args-vargs-issue-130372.rs | 2 - .../mismatch-args-vargs-issue-130372.stderr | 4 +- .../variadic-ffi-semantic-restrictions.rs | 1 - .../variadic-ffi-semantic-restrictions.stderr | 66 +++---- .../param-attrs-pretty.rs | 3 +- .../proc-macro-cannot-be-used.rs | 3 +- .../proc-macro-cannot-be-used.stderr | 162 +++++++++--------- tests/ui/sanitizer/kcfi-c-variadic.rs | 2 - tests/ui/thir-print/c-variadic.rs | 1 - tests/ui/thir-print/c-variadic.stderr | 2 +- tests/ui/thir-print/c-variadic.stdout | 12 +- 95 files changed, 332 insertions(+), 463 deletions(-) delete mode 100644 src/doc/unstable-book/src/language-features/c-variadic.md delete mode 100644 tests/ui/feature-gates/feature-gate-c_variadic.rs delete mode 100644 tests/ui/feature-gates/feature-gate-c_variadic.stderr diff --git a/compiler/rustc_ast_passes/src/feature_gate.rs b/compiler/rustc_ast_passes/src/feature_gate.rs index 5831636a81b2c..cc8b0ae00ba6e 100644 --- a/compiler/rustc_ast_passes/src/feature_gate.rs +++ b/compiler/rustc_ast_passes/src/feature_gate.rs @@ -1,4 +1,4 @@ -use rustc_ast::visit::{self, AssocCtxt, FnCtxt, FnKind, Visitor}; +use rustc_ast::visit::{self, AssocCtxt, FnKind, Visitor}; use rustc_ast::{self as ast, AttrVec, GenericBound, NodeId, PatKind, attr, token}; use rustc_attr_parsing::AttributeParser; use rustc_errors::msg; @@ -388,7 +388,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { visit::walk_poly_trait_ref(self, t); } - fn visit_fn(&mut self, fn_kind: FnKind<'a>, _: &AttrVec, span: Span, _: NodeId) { + fn visit_fn(&mut self, fn_kind: FnKind<'a>, _: &AttrVec, _: Span, _: NodeId) { if let Some(_header) = fn_kind.header() { // Stability of const fn methods are covered in `visit_assoc_item` below. } @@ -397,10 +397,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { self.check_late_bound_lifetime_defs(generic_params); } - if fn_kind.ctxt() != Some(FnCtxt::Foreign) && fn_kind.decl().c_variadic() { - gate!(self, c_variadic, span, "C-variadic functions are unstable"); - } - visit::walk_fn(self, fn_kind) } diff --git a/compiler/rustc_feature/src/accepted.rs b/compiler/rustc_feature/src/accepted.rs index 54a935d13c8c1..1442871b6310f 100644 --- a/compiler/rustc_feature/src/accepted.rs +++ b/compiler/rustc_feature/src/accepted.rs @@ -94,6 +94,8 @@ declare_features! ( (accepted, c_str_literals, "1.77.0", Some(105723)), /// Allows `extern "C-unwind" fn` to enable unwinding across ABI boundaries and treat `extern "C" fn` as nounwind. (accepted, c_unwind, "1.81.0", Some(74990)), + /// Allows using C-variadics. + (accepted, c_variadic, "CURRENT_RUSTC_VERSION", Some(44930)), /// Allows `#[cfg_attr(predicate, multiple, attributes, here)]`. (accepted, cfg_attr_multi, "1.33.0", Some(54881)), /// Allows the use of `#[cfg()]`. diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs index c175c3adc2f02..f616d376d6bb8 100644 --- a/compiler/rustc_feature/src/unstable.rs +++ b/compiler/rustc_feature/src/unstable.rs @@ -391,8 +391,6 @@ declare_features! ( (unstable, avx10_target_feature, "1.88.0", Some(138843)), /// Target features on bpf. (unstable, bpf_target_feature, "1.54.0", Some(150247)), - /// Allows using C-variadics. - (unstable, c_variadic, "1.34.0", Some(44930)), /// Allows defining c-variadic naked functions with any extern ABI that is allowed /// on c-variadic foreign functions. (unstable, c_variadic_naked_functions, "1.93.0", Some(148767)), diff --git a/library/core/src/ffi/mod.rs b/library/core/src/ffi/mod.rs index f1b928da7ef3c..5b9c2eac32ab1 100644 --- a/library/core/src/ffi/mod.rs +++ b/library/core/src/ffi/mod.rs @@ -23,20 +23,10 @@ use crate::fmt; #[stable(feature = "c_str_module", since = "1.88.0")] pub mod c_str; -#[unstable( - feature = "c_variadic", - issue = "44930", - reason = "the `c_variadic` feature has not been properly tested on all supported platforms" -)] +mod va_list; +#[stable(feature = "c_variadic", since = "CURRENT_RUSTC_VERSION")] pub use self::va_list::{VaArgSafe, VaList}; -#[unstable( - feature = "c_variadic", - issue = "44930", - reason = "the `c_variadic` feature has not been properly tested on all supported platforms" -)] -pub mod va_list; - mod primitives; #[stable(feature = "core_ffi_c", since = "1.64.0")] pub use self::primitives::{ diff --git a/library/core/src/ffi/va_list.rs b/library/core/src/ffi/va_list.rs index 020ea4513078d..d08e27e337d60 100644 --- a/library/core/src/ffi/va_list.rs +++ b/library/core/src/ffi/va_list.rs @@ -189,8 +189,6 @@ crate::cfg_select! { /// is automatically initialized (equivalent to calling `va_start` in C). /// /// ``` -/// #![feature(c_variadic)] -/// /// use std::ffi::VaList; /// /// /// # Safety @@ -224,11 +222,13 @@ crate::cfg_select! { /// terms of layout and ABI. #[repr(transparent)] #[lang = "va_list"] +#[stable(feature = "c_variadic", since = "CURRENT_RUSTC_VERSION")] pub struct VaList<'a> { inner: VaListInner, _marker: PhantomCovariantLifetime<'a>, } +#[stable(feature = "c_variadic", since = "CURRENT_RUSTC_VERSION")] impl fmt::Debug for VaList<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { // No need to include `_marker` in debug output. @@ -243,6 +243,7 @@ impl VaList<'_> { } } +#[stable(feature = "c_variadic", since = "CURRENT_RUSTC_VERSION")] #[rustc_const_unstable(feature = "const_c_variadic", issue = "151787")] impl<'f> const Clone for VaList<'f> { #[inline] // Avoid codegen when not used to help backends that don't support VaList. @@ -255,6 +256,7 @@ impl<'f> const Clone for VaList<'f> { } } +#[stable(feature = "c_variadic", since = "CURRENT_RUSTC_VERSION")] #[rustc_const_unstable(feature = "const_c_variadic", issue = "151787")] impl<'f> const Drop for VaList<'f> { #[inline] // Avoid codegen when not used to help backends that don't support VaList. @@ -264,6 +266,7 @@ impl<'f> const Drop for VaList<'f> { } } +#[unstable(feature = "c_variadic_internals", issue = "none")] mod sealed { pub trait Sealed {} @@ -318,6 +321,7 @@ mod sealed { // types with an alignment larger than 8, or with a non-scalar layout. Inline assembly can be used // to accept unsupported types in the meantime. #[lang = "va_arg_safe"] +#[stable(feature = "c_variadic", since = "CURRENT_RUSTC_VERSION")] pub unsafe trait VaArgSafe: sealed::Sealed {} crate::cfg_select! { @@ -326,7 +330,9 @@ crate::cfg_select! { // // - i8 is implicitly promoted to c_int in C, and cannot implement `VaArgSafe`. // - u8 is implicitly promoted to c_uint in C, and cannot implement `VaArgSafe`. + #[stable(feature = "c_variadic", since = "CURRENT_RUSTC_VERSION")] unsafe impl VaArgSafe for i16 {} + #[stable(feature = "c_variadic", since = "CURRENT_RUSTC_VERSION")] unsafe impl VaArgSafe for u16 {} } _ => { @@ -340,6 +346,7 @@ crate::cfg_select! { crate::cfg_select! { target_arch = "avr" => { // c_double is f32 on this target. + #[stable(feature = "c_variadic", since = "CURRENT_RUSTC_VERSION")] unsafe impl VaArgSafe for f32 {} } _ => { @@ -349,17 +356,26 @@ crate::cfg_select! { } } +#[stable(feature = "c_variadic", since = "CURRENT_RUSTC_VERSION")] unsafe impl VaArgSafe for i32 {} +#[stable(feature = "c_variadic", since = "CURRENT_RUSTC_VERSION")] unsafe impl VaArgSafe for i64 {} +#[stable(feature = "c_variadic", since = "CURRENT_RUSTC_VERSION")] unsafe impl VaArgSafe for isize {} +#[stable(feature = "c_variadic", since = "CURRENT_RUSTC_VERSION")] unsafe impl VaArgSafe for u32 {} +#[stable(feature = "c_variadic", since = "CURRENT_RUSTC_VERSION")] unsafe impl VaArgSafe for u64 {} +#[stable(feature = "c_variadic", since = "CURRENT_RUSTC_VERSION")] unsafe impl VaArgSafe for usize {} +#[stable(feature = "c_variadic", since = "CURRENT_RUSTC_VERSION")] unsafe impl VaArgSafe for f64 {} +#[stable(feature = "c_variadic", since = "CURRENT_RUSTC_VERSION")] unsafe impl VaArgSafe for *mut T {} +#[stable(feature = "c_variadic", since = "CURRENT_RUSTC_VERSION")] unsafe impl VaArgSafe for *const T {} // Check that relevant `core::ffi` types implement `VaArgSafe`. @@ -390,6 +406,7 @@ impl<'f> VaList<'f> { /// Calling this function with an incompatible type, an invalid value, or when there /// are no more variable arguments, is unsound. #[inline] // Avoid codegen when not used to help backends that don't support VaList. + #[stable(feature = "c_variadic", since = "CURRENT_RUSTC_VERSION")] #[rustc_const_unstable(feature = "const_c_variadic", issue = "151787")] pub const unsafe fn next_arg(&mut self) -> T { // SAFETY: the caller must uphold the safety contract for `va_arg`. diff --git a/library/core/src/intrinsics/mod.rs b/library/core/src/intrinsics/mod.rs index 94d0c7eab9227..c71085ef9f97d 100644 --- a/library/core/src/intrinsics/mod.rs +++ b/library/core/src/intrinsics/mod.rs @@ -53,7 +53,7 @@ issue = "none" )] -use crate::ffi::va_list::{VaArgSafe, VaList}; +use crate::ffi::{VaArgSafe, VaList}; use crate::marker::{ConstParamTy, DiscriminantKind, PointeeSized, Tuple}; use crate::{mem, ptr}; diff --git a/library/std/src/ffi/mod.rs b/library/std/src/ffi/mod.rs index 999bd5e63dc45..74d190b8c5eb6 100644 --- a/library/std/src/ffi/mod.rs +++ b/library/std/src/ffi/mod.rs @@ -166,12 +166,7 @@ pub mod c_str; #[stable(feature = "core_c_void", since = "1.30.0")] pub use core::ffi::c_void; -#[unstable( - feature = "c_variadic", - reason = "the `c_variadic` feature has not been properly tested on \ - all supported platforms", - issue = "44930" -)] +#[stable(feature = "c_variadic", since = "CURRENT_RUSTC_VERSION")] pub use core::ffi::{VaArgSafe, VaList}; #[stable(feature = "core_ffi_c", since = "1.64.0")] pub use core::ffi::{ diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index 807befec1ad11..2eaf436d3ad65 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -403,7 +403,6 @@ // Only for re-exporting: // tidy-alphabetical-start #![feature(async_iterator)] -#![feature(c_variadic)] #![feature(cfg_accessible)] #![feature(cfg_eval)] #![feature(concat_bytes)] diff --git a/src/doc/unstable-book/src/language-features/c-variadic.md b/src/doc/unstable-book/src/language-features/c-variadic.md deleted file mode 100644 index 72980ea91ba28..0000000000000 --- a/src/doc/unstable-book/src/language-features/c-variadic.md +++ /dev/null @@ -1,24 +0,0 @@ -# `c_variadic` - -The tracking issue for this feature is: [#44930] - -[#44930]: https://github.com/rust-lang/rust/issues/44930 - ------------------------- - -The `c_variadic` language feature enables C-variadic functions to be -defined in Rust. They may be called both from within Rust and via FFI. - -## Examples - -```rust -#![feature(c_variadic)] - -pub unsafe extern "C" fn add(n: usize, mut args: ...) -> usize { - let mut sum = 0; - for _ in 0..n { - sum += args.next_arg::(); - } - sum -} -``` diff --git a/src/tools/miri/tests/fail/c-variadic-mismatch-count.rs b/src/tools/miri/tests/fail/c-variadic-mismatch-count.rs index c01860cd1df90..1d1c441194489 100644 --- a/src/tools/miri/tests/fail/c-variadic-mismatch-count.rs +++ b/src/tools/miri/tests/fail/c-variadic-mismatch-count.rs @@ -1,5 +1,3 @@ -#![feature(c_variadic)] - unsafe extern "C" fn helper(_: i32, _: ...) {} fn main() { diff --git a/src/tools/miri/tests/fail/c-variadic-mismatch.rs b/src/tools/miri/tests/fail/c-variadic-mismatch.rs index bf44fb00bceec..8387f6e12d4eb 100644 --- a/src/tools/miri/tests/fail/c-variadic-mismatch.rs +++ b/src/tools/miri/tests/fail/c-variadic-mismatch.rs @@ -1,5 +1,3 @@ -#![feature(c_variadic)] - unsafe extern "C" fn helper(_: i32, _: ...) {} fn main() { diff --git a/src/tools/miri/tests/fail/c-variadic.rs b/src/tools/miri/tests/fail/c-variadic.rs index d36dccec8d8d8..59906163ff85b 100644 --- a/src/tools/miri/tests/fail/c-variadic.rs +++ b/src/tools/miri/tests/fail/c-variadic.rs @@ -1,5 +1,3 @@ -#![feature(c_variadic)] - //@error-in-other-file: Undefined Behavior: more C-variadic arguments read than were passed fn read_too_many() { diff --git a/src/tools/miri/tests/pass/c-variadic-ignored-argument.rs b/src/tools/miri/tests/pass/c-variadic-ignored-argument.rs index fe09a03edfffc..8bdb38e0b40e5 100644 --- a/src/tools/miri/tests/pass/c-variadic-ignored-argument.rs +++ b/src/tools/miri/tests/pass/c-variadic-ignored-argument.rs @@ -2,7 +2,6 @@ //@ ignore-target: powerpc # does not ignore ZST arguments //@ ignore-target: s390x # does not ignore ZST arguments //@ ignore-target: sparc # does not ignore ZST arguments -#![feature(c_variadic)] // Some platforms ignore ZSTs, meaning that the argument is not passed, even though it is part // of the callee's ABI. Test that this doesn't trip any asserts. diff --git a/src/tools/miri/tests/pass/c-variadic.rs b/src/tools/miri/tests/pass/c-variadic.rs index 61ff1303f328f..4f0e47685ec97 100644 --- a/src/tools/miri/tests/pass/c-variadic.rs +++ b/src/tools/miri/tests/pass/c-variadic.rs @@ -1,5 +1,3 @@ -#![feature(c_variadic)] - use std::ffi::{CStr, VaList, c_char, c_double, c_int, c_long}; fn ignores_arguments() { diff --git a/tests/assembly-llvm/c-variadic/arm.rs b/tests/assembly-llvm/c-variadic/arm.rs index 682e9736958b1..7f04349138297 100644 --- a/tests/assembly-llvm/c-variadic/arm.rs +++ b/tests/assembly-llvm/c-variadic/arm.rs @@ -5,7 +5,6 @@ //@ ignore-android #![no_std] #![crate_type = "lib"] -#![feature(c_variadic)] // Check that the assembly that rustc generates matches what clang emits. This example in particular // is related to https://github.com/rust-lang/rust/pull/144549 and shows the effect of us correctly diff --git a/tests/assembly-llvm/c-variadic/mips.rs b/tests/assembly-llvm/c-variadic/mips.rs index 9c74eeb8a6a17..ac552573b36ff 100644 --- a/tests/assembly-llvm/c-variadic/mips.rs +++ b/tests/assembly-llvm/c-variadic/mips.rs @@ -8,7 +8,7 @@ //@ [MIPS64] needs-llvm-components: mips //@ [MIPS64EL] compile-flags: -Copt-level=3 --target mips64el-unknown-linux-gnuabi64 //@ [MIPS64EL] needs-llvm-components: mips -#![feature(c_variadic, no_core, lang_items, intrinsics, rustc_attrs, asm_experimental_arch)] +#![feature(no_core, lang_items, intrinsics, rustc_attrs, asm_experimental_arch)] #![no_core] #![crate_type = "lib"] diff --git a/tests/assembly-llvm/c-variadic/sparc.rs b/tests/assembly-llvm/c-variadic/sparc.rs index 59f039e7df28b..4d1087f28f069 100644 --- a/tests/assembly-llvm/c-variadic/sparc.rs +++ b/tests/assembly-llvm/c-variadic/sparc.rs @@ -6,7 +6,7 @@ //@ [SPARC] needs-llvm-components: sparc //@ [SPARC64] compile-flags: -Copt-level=3 --target sparc64-unknown-linux-gnu //@ [SPARC64] needs-llvm-components: sparc -#![feature(c_variadic, no_core, lang_items, intrinsics, rustc_attrs, asm_experimental_arch)] +#![feature(no_core, lang_items, intrinsics, rustc_attrs, asm_experimental_arch)] #![no_core] #![crate_type = "lib"] diff --git a/tests/codegen-llvm/c-variadic-lifetime.rs b/tests/codegen-llvm/c-variadic-lifetime.rs index 302bc621df497..3532aaa142a40 100644 --- a/tests/codegen-llvm/c-variadic-lifetime.rs +++ b/tests/codegen-llvm/c-variadic-lifetime.rs @@ -1,6 +1,5 @@ //@ add-minicore //@ compile-flags: -Copt-level=3 -#![feature(c_variadic)] #![crate_type = "lib"] // Check that `%args` explicitly has its lifetime start and end. Being explicit can improve diff --git a/tests/codegen-llvm/cffi/c-variadic-inline.rs b/tests/codegen-llvm/cffi/c-variadic-inline.rs index 0df5bd4a55b50..a6b23ccf4a42b 100644 --- a/tests/codegen-llvm/cffi/c-variadic-inline.rs +++ b/tests/codegen-llvm/cffi/c-variadic-inline.rs @@ -1,5 +1,4 @@ //@ compile-flags: -C opt-level=3 -#![feature(c_variadic)] // Test that the inline attributes are accepted on C-variadic functions. // diff --git a/tests/codegen-llvm/cffi/c-variadic-naked.rs b/tests/codegen-llvm/cffi/c-variadic-naked.rs index 5843628b6330a..fca66e3e26b71 100644 --- a/tests/codegen-llvm/cffi/c-variadic-naked.rs +++ b/tests/codegen-llvm/cffi/c-variadic-naked.rs @@ -4,7 +4,6 @@ // tests that `va_start` is not injected into naked functions #![crate_type = "lib"] -#![feature(c_variadic)] #![no_std] #[unsafe(naked)] diff --git a/tests/codegen-llvm/cffi/c-variadic-opt.rs b/tests/codegen-llvm/cffi/c-variadic-opt.rs index c779b25450fd1..8decb23743615 100644 --- a/tests/codegen-llvm/cffi/c-variadic-opt.rs +++ b/tests/codegen-llvm/cffi/c-variadic-opt.rs @@ -1,7 +1,6 @@ //@ compile-flags: -C opt-level=3 #![crate_type = "lib"] -#![feature(c_variadic)] #![no_std] use core::ffi::VaList; diff --git a/tests/codegen-llvm/cffi/c-variadic-va_list.rs b/tests/codegen-llvm/cffi/c-variadic-va_list.rs index 0b3cda677ce20..1171060209fc4 100644 --- a/tests/codegen-llvm/cffi/c-variadic-va_list.rs +++ b/tests/codegen-llvm/cffi/c-variadic-va_list.rs @@ -2,7 +2,6 @@ //@ compile-flags: -Copt-level=3 #![crate_type = "lib"] -#![feature(c_variadic)] #![no_std] use core::ffi::VaList; diff --git a/tests/codegen-llvm/cffi/c-variadic.rs b/tests/codegen-llvm/cffi/c-variadic.rs index 0fa63b42c2de6..d21e3412fe694 100644 --- a/tests/codegen-llvm/cffi/c-variadic.rs +++ b/tests/codegen-llvm/cffi/c-variadic.rs @@ -2,7 +2,6 @@ //@ compile-flags: -C no-prepopulate-passes -Copt-level=0 #![crate_type = "lib"] -#![feature(c_variadic)] #![no_std] use core::ffi::VaList; diff --git a/tests/mir-opt/inline/inline_compatibility.rs b/tests/mir-opt/inline/inline_compatibility.rs index a894bdf76842d..3f72584017abd 100644 --- a/tests/mir-opt/inline/inline_compatibility.rs +++ b/tests/mir-opt/inline/inline_compatibility.rs @@ -5,7 +5,6 @@ #![crate_type = "lib"] #![feature(sanitize)] -#![feature(c_variadic)] #[inline] #[target_feature(enable = "sse2")] diff --git a/tests/pretty/fn-variadic.rs b/tests/pretty/fn-variadic.rs index 88eecee6e380e..3aad4a0dbe2bf 100644 --- a/tests/pretty/fn-variadic.rs +++ b/tests/pretty/fn-variadic.rs @@ -2,7 +2,6 @@ // See issue #58853. //@ pp-exact -#![feature(c_variadic)] extern "C" { pub fn foo(x: i32, ...); diff --git a/tests/pretty/hir-fn-variadic.pp b/tests/pretty/hir-fn-variadic.pp index 50ad30f7cc6cd..cdf61d0cb1158 100644 --- a/tests/pretty/hir-fn-variadic.pp +++ b/tests/pretty/hir-fn-variadic.pp @@ -1,4 +1,3 @@ -#![attr = Feature([c_variadic#0])] extern crate std; #[attr = PreludeImport] use ::std::prelude::rust_2015::*; @@ -6,7 +5,6 @@ //@ pretty-mode:hir //@ pp-exact:hir-fn-variadic.pp - extern "C" { unsafe fn foo(x: i32, va1: ...); } diff --git a/tests/pretty/hir-fn-variadic.rs b/tests/pretty/hir-fn-variadic.rs index 4daf8d9aeb525..c85219fda0ed9 100644 --- a/tests/pretty/hir-fn-variadic.rs +++ b/tests/pretty/hir-fn-variadic.rs @@ -2,8 +2,6 @@ //@ pretty-mode:hir //@ pp-exact:hir-fn-variadic.pp -#![feature(c_variadic)] - extern "C" { pub fn foo(x: i32, va1: ...); } diff --git a/tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs b/tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs index f3d82474e94aa..90b999f9569ae 100644 --- a/tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs +++ b/tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs @@ -1,5 +1,4 @@ #![crate_type = "staticlib"] -#![feature(c_variadic)] use core::ffi::{CStr, VaList, c_char, c_double, c_int, c_long, c_longlong}; diff --git a/tests/ui-fulldeps/rustc_public/check_abi.rs b/tests/ui-fulldeps/rustc_public/check_abi.rs index d823e76b93cd0..4cf79b1ac8005 100644 --- a/tests/ui-fulldeps/rustc_public/check_abi.rs +++ b/tests/ui-fulldeps/rustc_public/check_abi.rs @@ -185,7 +185,6 @@ fn generate_input(path: &str) -> std::io::Result<()> { write!( file, r#" - #![feature(c_variadic)] #![allow(unused_variables)] use std::num::NonZero; diff --git a/tests/ui/abi/variadic-ffi.rs b/tests/ui/abi/variadic-ffi.rs index 42ff8d0dbb36e..0f6183d6e2d40 100644 --- a/tests/ui/abi/variadic-ffi.rs +++ b/tests/ui/abi/variadic-ffi.rs @@ -1,8 +1,6 @@ //@ run-pass //@ ignore-backends: gcc -#![feature(c_variadic)] - use std::ffi::VaList; #[link(name = "rust_test_helpers", kind = "static")] diff --git a/tests/ui/c-variadic/copy.rs b/tests/ui/c-variadic/copy.rs index 5f3ec25581c9e..7befce36902c7 100644 --- a/tests/ui/c-variadic/copy.rs +++ b/tests/ui/c-variadic/copy.rs @@ -1,6 +1,5 @@ //@ run-pass //@ ignore-backends: gcc -#![feature(c_variadic)] // Test the behavior of `VaList::clone`. In C a `va_list` is duplicated using `va_copy`, but the // rust api just uses `Clone`. This should create a completely independent cursor into the diff --git a/tests/ui/c-variadic/inherent-method.rs b/tests/ui/c-variadic/inherent-method.rs index c71e57816c824..5f5cdc76d4a2e 100644 --- a/tests/ui/c-variadic/inherent-method.rs +++ b/tests/ui/c-variadic/inherent-method.rs @@ -1,7 +1,5 @@ //@ run-pass //@ ignore-backends: gcc -#![feature(c_variadic)] - #[repr(transparent)] struct S(i32); diff --git a/tests/ui/c-variadic/issue-86053-1.rs b/tests/ui/c-variadic/issue-86053-1.rs index e63d348dbb3bc..40efb5954f603 100644 --- a/tests/ui/c-variadic/issue-86053-1.rs +++ b/tests/ui/c-variadic/issue-86053-1.rs @@ -1,6 +1,5 @@ // Regression test for the ICE described in issue #86053. -#![feature(c_variadic)] #![crate_type="lib"] fn ordering4 < 'a , 'b > ( a : , self , self , self , diff --git a/tests/ui/c-variadic/issue-86053-1.stderr b/tests/ui/c-variadic/issue-86053-1.stderr index d9bce99cfdb4d..b18bf603dd36a 100644 --- a/tests/ui/c-variadic/issue-86053-1.stderr +++ b/tests/ui/c-variadic/issue-86053-1.stderr @@ -1,53 +1,53 @@ error: expected type, found `,` - --> $DIR/issue-86053-1.rs:6:47 + --> $DIR/issue-86053-1.rs:5:47 | LL | fn ordering4 < 'a , 'b > ( a : , self , self , self , | ^ expected type error: unexpected `self` parameter in function - --> $DIR/issue-86053-1.rs:6:51 + --> $DIR/issue-86053-1.rs:5:51 | LL | fn ordering4 < 'a , 'b > ( a : , self , self , self , | ^^^^ must be the first parameter of an associated function error: unexpected `self` parameter in function - --> $DIR/issue-86053-1.rs:6:58 + --> $DIR/issue-86053-1.rs:5:58 | LL | fn ordering4 < 'a , 'b > ( a : , self , self , self , | ^^^^ must be the first parameter of an associated function error: unexpected `self` parameter in function - --> $DIR/issue-86053-1.rs:6:67 + --> $DIR/issue-86053-1.rs:5:67 | LL | fn ordering4 < 'a , 'b > ( a : , self , self , self , | ^^^^ must be the first parameter of an associated function error: unexpected `self` parameter in function - --> $DIR/issue-86053-1.rs:11:5 + --> $DIR/issue-86053-1.rs:10:5 | LL | self , _: ... , self , self , _: ... ) where F : FnOnce ( & 'a & 'b usize ) { | ^^^^ must be the first parameter of an associated function error: unexpected `self` parameter in function - --> $DIR/issue-86053-1.rs:11:23 + --> $DIR/issue-86053-1.rs:10:23 | LL | self , _: ... , self , self , _: ... ) where F : FnOnce ( & 'a & 'b usize ) { | ^^^^ must be the first parameter of an associated function error: unexpected `self` parameter in function - --> $DIR/issue-86053-1.rs:11:32 + --> $DIR/issue-86053-1.rs:10:32 | LL | self , _: ... , self , self , _: ... ) where F : FnOnce ( & 'a & 'b usize ) { | ^^^^ must be the first parameter of an associated function error: `...` must be the last argument of a C-variadic function - --> $DIR/issue-86053-1.rs:11:12 + --> $DIR/issue-86053-1.rs:10:12 | LL | self , _: ... , self , self , _: ... ) where F : FnOnce ( & 'a & 'b usize ) { | ^^^^^^ error: `...` is not supported for non-extern functions - --> $DIR/issue-86053-1.rs:11:39 + --> $DIR/issue-86053-1.rs:10:39 | LL | self , _: ... , self , self , _: ... ) where F : FnOnce ( & 'a & 'b usize ) { | ^^^^^^ @@ -55,7 +55,7 @@ LL | self , _: ... , self , self , _: ... ) where F : FnOnce ( & 'a & 'b = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list error[E0425]: cannot find type `F` in this scope - --> $DIR/issue-86053-1.rs:11:54 + --> $DIR/issue-86053-1.rs:10:54 | LL | self , _: ... , self , self , _: ... ) where F : FnOnce ( & 'a & 'b usize ) { | ^ diff --git a/tests/ui/c-variadic/issue-86053-2.rs b/tests/ui/c-variadic/issue-86053-2.rs index 0914676a35f4f..76333a44bf538 100644 --- a/tests/ui/c-variadic/issue-86053-2.rs +++ b/tests/ui/c-variadic/issue-86053-2.rs @@ -1,8 +1,6 @@ // Regression test for the ICE caused by the example in // https://github.com/rust-lang/rust/issues/86053#issuecomment-855672258 -#![feature(c_variadic)] - trait H {} unsafe extern "C" fn ordering4<'a, F: H<&'static &'a ()>>(_: (), _: ...) {} diff --git a/tests/ui/c-variadic/issue-86053-2.stderr b/tests/ui/c-variadic/issue-86053-2.stderr index 823dadff6f895..de7d743a2a242 100644 --- a/tests/ui/c-variadic/issue-86053-2.stderr +++ b/tests/ui/c-variadic/issue-86053-2.stderr @@ -1,12 +1,12 @@ error[E0491]: in type `&'static &'a ()`, reference has a longer lifetime than the data it references - --> $DIR/issue-86053-2.rs:8:39 + --> $DIR/issue-86053-2.rs:6:39 | LL | unsafe extern "C" fn ordering4<'a, F: H<&'static &'a ()>>(_: (), _: ...) {} | ^^^^^^^^^^^^^^^^^^ | = note: the pointer is valid for the static lifetime note: but the referenced data is only valid for the lifetime `'a` as defined here - --> $DIR/issue-86053-2.rs:8:32 + --> $DIR/issue-86053-2.rs:6:32 | LL | unsafe extern "C" fn ordering4<'a, F: H<&'static &'a ()>>(_: (), _: ...) {} | ^^ diff --git a/tests/ui/c-variadic/naked-invalid.rs b/tests/ui/c-variadic/naked-invalid.rs index 2cc4aaafbfcc0..2aeb400c9853e 100644 --- a/tests/ui/c-variadic/naked-invalid.rs +++ b/tests/ui/c-variadic/naked-invalid.rs @@ -4,7 +4,7 @@ //@ ignore-backends: gcc #![feature(no_core, lang_items, rustc_attrs)] -#![feature(c_variadic, c_variadic_naked_functions, abi_x86_interrupt, naked_functions_rustic_abi)] +#![feature(c_variadic_naked_functions, abi_x86_interrupt, naked_functions_rustic_abi)] #![crate_type = "rlib"] #![no_core] diff --git a/tests/ui/c-variadic/naked.rs b/tests/ui/c-variadic/naked.rs index 73664206d9ced..cda6a67d04681 100644 --- a/tests/ui/c-variadic/naked.rs +++ b/tests/ui/c-variadic/naked.rs @@ -1,7 +1,7 @@ //@ run-pass //@ only-x86_64 //@ only-linux -#![feature(c_variadic, c_variadic_naked_functions)] +#![feature(c_variadic_naked_functions)] #[repr(C)] #[derive(Debug, PartialEq)] diff --git a/tests/ui/c-variadic/no-closure.rs b/tests/ui/c-variadic/no-closure.rs index 830ed962a8c4a..254f1e10b125e 100644 --- a/tests/ui/c-variadic/no-closure.rs +++ b/tests/ui/c-variadic/no-closure.rs @@ -1,4 +1,3 @@ -#![feature(c_variadic)] #![crate_type = "lib"] // Check that `...` in closures is rejected. diff --git a/tests/ui/c-variadic/no-closure.stderr b/tests/ui/c-variadic/no-closure.stderr index 0946c4632e6e4..088cc44d47ed0 100644 --- a/tests/ui/c-variadic/no-closure.stderr +++ b/tests/ui/c-variadic/no-closure.stderr @@ -1,5 +1,5 @@ error: unexpected `...` - --> $DIR/no-closure.rs:6:35 + --> $DIR/no-closure.rs:5:35 | LL | const F: extern "C" fn(...) = |_: ...| {}; | ^^^ @@ -7,7 +7,7 @@ LL | const F: extern "C" fn(...) = |_: ...| {}; = note: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list error: unexpected `...` - --> $DIR/no-closure.rs:11:14 + --> $DIR/no-closure.rs:10:14 | LL | let f = |...| {}; | ^^^ not a valid pattern @@ -15,7 +15,7 @@ LL | let f = |...| {}; = note: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list error: unexpected `...` - --> $DIR/no-closure.rs:16:17 + --> $DIR/no-closure.rs:15:17 | LL | let f = |_: ...| {}; | ^^^ diff --git a/tests/ui/c-variadic/not-async.rs b/tests/ui/c-variadic/not-async.rs index a4ad9c6bceb54..9387c984324ec 100644 --- a/tests/ui/c-variadic/not-async.rs +++ b/tests/ui/c-variadic/not-async.rs @@ -1,5 +1,4 @@ //@ edition: 2021 -#![feature(c_variadic)] #![crate_type = "lib"] async unsafe extern "C" fn fn_cannot_be_async(x: isize, _: ...) {} diff --git a/tests/ui/c-variadic/not-async.stderr b/tests/ui/c-variadic/not-async.stderr index bb8cc64e15fa4..921210382236c 100644 --- a/tests/ui/c-variadic/not-async.stderr +++ b/tests/ui/c-variadic/not-async.stderr @@ -1,17 +1,17 @@ error: functions cannot be both `async` and C-variadic - --> $DIR/not-async.rs:5:1 + --> $DIR/not-async.rs:4:1 | LL | async unsafe extern "C" fn fn_cannot_be_async(x: isize, _: ...) {} | ^^^^^ `async` because of this ^^^^^^ C-variadic because of this error: functions cannot be both `async` and C-variadic - --> $DIR/not-async.rs:12:5 + --> $DIR/not-async.rs:11:5 | LL | async unsafe extern "C" fn method_cannot_be_async(x: isize, _: ...) {} | ^^^^^ `async` because of this ^^^^^^ C-variadic because of this error[E0700]: hidden type for `impl Future` captures lifetime that does not appear in bounds - --> $DIR/not-async.rs:5:65 + --> $DIR/not-async.rs:4:65 | LL | async unsafe extern "C" fn fn_cannot_be_async(x: isize, _: ...) {} | -^^ @@ -21,7 +21,7 @@ LL | async unsafe extern "C" fn fn_cannot_be_async(x: isize, _: ...) {} = note: hidden type `{async fn body of fn_cannot_be_async()}` captures lifetime `'_` error[E0700]: hidden type for `impl Future` captures lifetime that does not appear in bounds - --> $DIR/not-async.rs:12:73 + --> $DIR/not-async.rs:11:73 | LL | async unsafe extern "C" fn method_cannot_be_async(x: isize, _: ...) {} | -^^ diff --git a/tests/ui/c-variadic/not-dyn-compatible.rs b/tests/ui/c-variadic/not-dyn-compatible.rs index 6676cc661c875..f8d5fd4a39288 100644 --- a/tests/ui/c-variadic/not-dyn-compatible.rs +++ b/tests/ui/c-variadic/not-dyn-compatible.rs @@ -3,7 +3,6 @@ // Creating a function pointer from a method on an `&dyn T` value creates a ReifyShim. // This shim cannot reliably forward C-variadic arguments. Thus the trait as a whole // is dyn-incompatible to prevent invalid shims from being created. -#![feature(c_variadic)] #[repr(transparent)] struct Struct(u64); diff --git a/tests/ui/c-variadic/not-dyn-compatible.stderr b/tests/ui/c-variadic/not-dyn-compatible.stderr index 76630600c511f..40274371a09b4 100644 --- a/tests/ui/c-variadic/not-dyn-compatible.stderr +++ b/tests/ui/c-variadic/not-dyn-compatible.stderr @@ -1,12 +1,12 @@ error[E0038]: the trait `Trait` is not dyn compatible - --> $DIR/not-dyn-compatible.rs:27:30 + --> $DIR/not-dyn-compatible.rs:26:30 | LL | let dyn_object: &dyn Trait = &Struct(64); | ^^^^^ `Trait` is not dyn compatible | note: for a trait to be dyn compatible it needs to allow building a vtable for more information, visit - --> $DIR/not-dyn-compatible.rs:14:26 + --> $DIR/not-dyn-compatible.rs:13:26 | LL | trait Trait { | ----- this trait is not dyn compatible... diff --git a/tests/ui/c-variadic/pass-by-value-abi.rs b/tests/ui/c-variadic/pass-by-value-abi.rs index a7cf37295a74a..6c046bed50a81 100644 --- a/tests/ui/c-variadic/pass-by-value-abi.rs +++ b/tests/ui/c-variadic/pass-by-value-abi.rs @@ -17,7 +17,7 @@ //@ [win] only-windows //@ [win] only-x86_64 -#![feature(rustc_attrs, c_variadic)] +#![feature(rustc_attrs)] #![crate_type = "lib"] // Can't use `minicore` here as this is testing the implementation in `core::ffi` specifically. diff --git a/tests/ui/c-variadic/roundtrip.rs b/tests/ui/c-variadic/roundtrip.rs index 22a545fec5a88..846bca96a43a1 100644 --- a/tests/ui/c-variadic/roundtrip.rs +++ b/tests/ui/c-variadic/roundtrip.rs @@ -1,6 +1,6 @@ //@ run-pass //@ ignore-backends: gcc -#![feature(c_variadic, const_c_variadic, const_destruct, const_raw_ptr_comparison)] +#![feature(const_c_variadic, const_destruct, const_raw_ptr_comparison)] use std::ffi::*; diff --git a/tests/ui/c-variadic/same-program-multiple-abis-arm.rs b/tests/ui/c-variadic/same-program-multiple-abis-arm.rs index 301485519b9b9..62a701c942d38 100644 --- a/tests/ui/c-variadic/same-program-multiple-abis-arm.rs +++ b/tests/ui/c-variadic/same-program-multiple-abis-arm.rs @@ -2,7 +2,7 @@ //@ only-arm //@ ignore-thumb (this test uses arm assembly) //@ only-eabihf (the assembly below requires float hardware support) -#![feature(c_variadic, c_variadic_naked_functions)] +#![feature(c_variadic_naked_functions)] // Check that multiple c-variadic calling conventions can be used in the same program. // @@ -21,8 +21,6 @@ fn main() { // following code compiled for the `armv7-unknown-linux-gnueabihf` target: // // ```rust -// #![feature(c_variadic)] -// // #[unsafe(no_mangle)] // unsafe extern "C" fn variadic(a: f64, mut args: ...) -> f64 { // let b = args.next_arg::(); diff --git a/tests/ui/c-variadic/same-program-multiple-abis-x86_64.rs b/tests/ui/c-variadic/same-program-multiple-abis-x86_64.rs index 1f6f676780050..78f574667bc0d 100644 --- a/tests/ui/c-variadic/same-program-multiple-abis-x86_64.rs +++ b/tests/ui/c-variadic/same-program-multiple-abis-x86_64.rs @@ -1,6 +1,6 @@ //@ run-pass //@ only-x86_64 -#![feature(c_variadic, c_variadic_naked_functions)] +#![feature(c_variadic_naked_functions)] // Check that multiple c-variadic calling conventions can be used in the same program. // @@ -20,8 +20,6 @@ fn main() { // targets, respectively: // // ```rust -// #![feature(c_variadic)] -// // #[unsafe(no_mangle)] // unsafe extern "C" fn variadic(a: u32, mut args: ...) -> u32 { // let b = args.next_arg::(); diff --git a/tests/ui/c-variadic/trait-method.rs b/tests/ui/c-variadic/trait-method.rs index 753c0fbe89f22..9a3ba87614214 100644 --- a/tests/ui/c-variadic/trait-method.rs +++ b/tests/ui/c-variadic/trait-method.rs @@ -1,6 +1,5 @@ //@ run-pass //@ ignore-backends: gcc -#![feature(c_variadic)] #[repr(transparent)] struct Struct(i32); diff --git a/tests/ui/c-variadic/unsupported-abi.rs b/tests/ui/c-variadic/unsupported-abi.rs index f055ea4819146..1b62003a9275b 100644 --- a/tests/ui/c-variadic/unsupported-abi.rs +++ b/tests/ui/c-variadic/unsupported-abi.rs @@ -3,7 +3,7 @@ //@ compile-flags: --target=i686-pc-windows-gnu --crate-type=rlib //@ ignore-backends: gcc #![no_core] -#![feature(no_core, lang_items, c_variadic)] +#![feature(no_core, lang_items)] // Test that ABIs for which C-variadics are not supported report an error. diff --git a/tests/ui/c-variadic/valid.rs b/tests/ui/c-variadic/valid.rs index 2ea50e668d3b2..9d937e611afe8 100644 --- a/tests/ui/c-variadic/valid.rs +++ b/tests/ui/c-variadic/valid.rs @@ -1,6 +1,5 @@ //@ run-pass //@ ignore-backends: gcc -#![feature(c_variadic)] // In rust (and C23 and above) `...` can be the only argument. unsafe extern "C" fn only_dot_dot_dot(mut ap: ...) -> i32 { diff --git a/tests/ui/c-variadic/variadic-ffi-4.rs b/tests/ui/c-variadic/variadic-ffi-4.rs index d9e2e617ce3a1..f89a9aec74691 100644 --- a/tests/ui/c-variadic/variadic-ffi-4.rs +++ b/tests/ui/c-variadic/variadic-ffi-4.rs @@ -1,6 +1,5 @@ #![crate_type = "lib"] #![no_std] -#![feature(c_variadic)] use core::ffi::VaList; diff --git a/tests/ui/c-variadic/variadic-ffi-4.stderr b/tests/ui/c-variadic/variadic-ffi-4.stderr index 01ace5c796800..d53f1f527748c 100644 --- a/tests/ui/c-variadic/variadic-ffi-4.stderr +++ b/tests/ui/c-variadic/variadic-ffi-4.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/variadic-ffi-4.rs:8:5 + --> $DIR/variadic-ffi-4.rs:7:5 | LL | pub unsafe extern "C" fn no_escape0<'f>(_: usize, ap: ...) -> VaList<'f> { | -- -- has type `VaList<'1>` @@ -9,7 +9,7 @@ LL | ap | ^^ function was supposed to return data with lifetime `'f` but it is returning data with lifetime `'1` error: lifetime may not live long enough - --> $DIR/variadic-ffi-4.rs:13:5 + --> $DIR/variadic-ffi-4.rs:12:5 | LL | pub unsafe extern "C" fn no_escape1(_: usize, ap: ...) -> VaList<'static> { | -- has type `VaList<'1>` @@ -17,7 +17,7 @@ LL | ap | ^^ returning this value requires that `'1` must outlive `'static` error: lifetime may not live long enough - --> $DIR/variadic-ffi-4.rs:17:5 + --> $DIR/variadic-ffi-4.rs:16:5 | LL | pub unsafe extern "C" fn no_escape3(_: usize, mut ap0: &mut VaList, mut ap1: ...) { | ------- ------- has type `VaList<'1>` @@ -27,7 +27,7 @@ LL | *ap0 = ap1; | ^^^^ assignment requires that `'1` must outlive `'2` error: lifetime may not live long enough - --> $DIR/variadic-ffi-4.rs:22:5 + --> $DIR/variadic-ffi-4.rs:21:5 | LL | pub unsafe extern "C" fn no_escape4(_: usize, mut ap0: &mut VaList, mut ap1: ...) { | ------- ------- has type `VaList<'1>` @@ -41,7 +41,7 @@ LL | ap0 = &mut ap1; = help: see for more information about variance error: lifetime may not live long enough - --> $DIR/variadic-ffi-4.rs:22:5 + --> $DIR/variadic-ffi-4.rs:21:5 | LL | pub unsafe extern "C" fn no_escape4(_: usize, mut ap0: &mut VaList, mut ap1: ...) { | ------- ------- has type `VaList<'1>` @@ -55,7 +55,7 @@ LL | ap0 = &mut ap1; = help: see for more information about variance error[E0597]: `ap1` does not live long enough - --> $DIR/variadic-ffi-4.rs:22:11 + --> $DIR/variadic-ffi-4.rs:21:11 | LL | pub unsafe extern "C" fn no_escape4(_: usize, mut ap0: &mut VaList, mut ap1: ...) { | - ------- binding `ap1` declared here @@ -71,7 +71,7 @@ LL | } | - `ap1` dropped here while still borrowed error: lifetime may not live long enough - --> $DIR/variadic-ffi-4.rs:29:5 + --> $DIR/variadic-ffi-4.rs:28:5 | LL | pub unsafe extern "C" fn no_escape5(_: usize, mut ap0: &mut VaList, mut ap1: ...) { | ------- ------- has type `VaList<'1>` diff --git a/tests/ui/c-variadic/variadic-ffi-6.rs b/tests/ui/c-variadic/variadic-ffi-6.rs index 4dd8a2d452181..fd5a6db03b49c 100644 --- a/tests/ui/c-variadic/variadic-ffi-6.rs +++ b/tests/ui/c-variadic/variadic-ffi-6.rs @@ -1,13 +1,11 @@ -#![crate_type="lib"] -#![feature(c_variadic)] +#![crate_type = "lib"] -pub unsafe extern "C" fn use_vararg_lifetime( - x: usize, - y: ... -) -> &usize { //~ ERROR missing lifetime specifier +pub unsafe extern "C" fn use_vararg_lifetime(x: usize, y: ...) -> &usize { + //~^ ERROR missing lifetime specifier &0 } -pub unsafe extern "C" fn use_normal_arg_lifetime(x: &usize, y: ...) -> &usize { // OK +pub unsafe extern "C" fn use_normal_arg_lifetime(x: &usize, y: ...) -> &usize { + // OK x } diff --git a/tests/ui/c-variadic/variadic-ffi-6.stderr b/tests/ui/c-variadic/variadic-ffi-6.stderr index 344bfed4b42a2..1b743070dc83e 100644 --- a/tests/ui/c-variadic/variadic-ffi-6.stderr +++ b/tests/ui/c-variadic/variadic-ffi-6.stderr @@ -1,22 +1,22 @@ error[E0106]: missing lifetime specifier - --> $DIR/variadic-ffi-6.rs:7:6 + --> $DIR/variadic-ffi-6.rs:3:67 | -LL | ) -> &usize { - | ^ expected named lifetime parameter +LL | pub unsafe extern "C" fn use_vararg_lifetime(x: usize, y: ...) -> &usize { + | ^ expected named lifetime parameter | = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static` | -LL | ) -> &'static usize { - | +++++++ +LL | pub unsafe extern "C" fn use_vararg_lifetime(x: usize, y: ...) -> &'static usize { + | +++++++ help: instead, you are more likely to want to change one of the arguments to be borrowed... | -LL | x: &usize, - | + +LL | pub unsafe extern "C" fn use_vararg_lifetime(x: &usize, y: ...) -> &usize { + | + help: ...or alternatively, you might want to return an owned value | -LL - ) -> &usize { -LL + ) -> usize { +LL - pub unsafe extern "C" fn use_vararg_lifetime(x: usize, y: ...) -> &usize { +LL + pub unsafe extern "C" fn use_vararg_lifetime(x: usize, y: ...) -> usize { | error: aborting due to 1 previous error diff --git a/tests/ui/c-variadic/variadic-unreachable-arg-error.rs b/tests/ui/c-variadic/variadic-unreachable-arg-error.rs index e3fd24a088cfd..a9d8a13893ddf 100644 --- a/tests/ui/c-variadic/variadic-unreachable-arg-error.rs +++ b/tests/ui/c-variadic/variadic-unreachable-arg-error.rs @@ -1,7 +1,5 @@ //@ check-pass -#![feature(c_variadic)] - extern "C" { fn foo(f: isize, x: u8, ...); } diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/c-variadic.rs b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/c-variadic.rs index 213b69b6fa201..40a0f152e3005 100644 --- a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/c-variadic.rs +++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/c-variadic.rs @@ -3,7 +3,7 @@ //@ compile-flags: --target thumbv8m.main-none-eabi --crate-type lib //@ needs-llvm-components: arm //@ ignore-backends: gcc -#![feature(cmse_nonsecure_entry, c_variadic, no_core, lang_items)] +#![feature(cmse_nonsecure_entry, no_core, lang_items)] #![no_core] extern crate minicore; diff --git a/tests/ui/consts/const-eval/c-variadic-fail.rs b/tests/ui/consts/const-eval/c-variadic-fail.rs index a394de34a4804..b18dbab44a2f3 100644 --- a/tests/ui/consts/const-eval/c-variadic-fail.rs +++ b/tests/ui/consts/const-eval/c-variadic-fail.rs @@ -1,6 +1,5 @@ //@ build-fail //@ ignore-parallel-frontend different alloc ids -#![feature(c_variadic)] #![feature(const_c_variadic)] #![feature(const_trait_impl)] #![feature(const_destruct)] diff --git a/tests/ui/consts/const-eval/c-variadic-fail.stderr b/tests/ui/consts/const-eval/c-variadic-fail.stderr index 4b0aed10d7647..d8718d9c01b08 100644 --- a/tests/ui/consts/const-eval/c-variadic-fail.stderr +++ b/tests/ui/consts/const-eval/c-variadic-fail.stderr @@ -1,11 +1,11 @@ error[E0080]: more C-variadic arguments read than were passed - --> $DIR/c-variadic-fail.rs:28:13 + --> $DIR/c-variadic-fail.rs:27:13 | LL | const { read_n::<1>() } | ^^^^^^^^^^^^^ evaluation of `read_too_many::{constant#2}` failed inside this call | note: inside `read_n::<1>` - --> $DIR/c-variadic-fail.rs:16:17 + --> $DIR/c-variadic-fail.rs:15:17 | LL | let _ = ap.next_arg::(); | ^^^^^^^^^^^^^^^^^^^^ @@ -13,13 +13,13 @@ note: inside `VaList::<'_>::next_arg::` --> $SRC_DIR/core/src/ffi/va_list.rs:LL:COL note: erroneous constant encountered - --> $DIR/c-variadic-fail.rs:28:5 + --> $DIR/c-variadic-fail.rs:27:5 | LL | const { read_n::<1>() } | ^^^^^^^^^^^^^^^^^^^^^^^ note: erroneous constant encountered - --> $DIR/c-variadic-fail.rs:28:5 + --> $DIR/c-variadic-fail.rs:27:5 | LL | const { read_n::<1>() } | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -27,13 +27,13 @@ LL | const { read_n::<1>() } = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0080]: more C-variadic arguments read than were passed - --> $DIR/c-variadic-fail.rs:32:13 + --> $DIR/c-variadic-fail.rs:31:13 | LL | const { read_n::<2>(1) } | ^^^^^^^^^^^^^^ evaluation of `read_too_many::{constant#3}` failed inside this call | note: inside `read_n::<2>` - --> $DIR/c-variadic-fail.rs:16:17 + --> $DIR/c-variadic-fail.rs:15:17 | LL | let _ = ap.next_arg::(); | ^^^^^^^^^^^^^^^^^^^^ @@ -41,13 +41,13 @@ note: inside `VaList::<'_>::next_arg::` --> $SRC_DIR/core/src/ffi/va_list.rs:LL:COL note: erroneous constant encountered - --> $DIR/c-variadic-fail.rs:32:5 + --> $DIR/c-variadic-fail.rs:31:5 | LL | const { read_n::<2>(1) } | ^^^^^^^^^^^^^^^^^^^^^^^^ note: erroneous constant encountered - --> $DIR/c-variadic-fail.rs:32:5 + --> $DIR/c-variadic-fail.rs:31:5 | LL | const { read_n::<2>(1) } | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -55,13 +55,13 @@ LL | const { read_n::<2>(1) } = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0080]: va_arg type mismatch: requested `u32`, but next argument is `i32` - --> $DIR/c-variadic-fail.rs:50:13 + --> $DIR/c-variadic-fail.rs:49:13 | LL | const { read_as::(1i32) }; | ^^^^^^^^^^^^^^^^^^^^ evaluation of `read_cast::{constant#6}` failed inside this call | note: inside `read_as::` - --> $DIR/c-variadic-fail.rs:37:5 + --> $DIR/c-variadic-fail.rs:36:5 | LL | ap.next_arg::() | ^^^^^^^^^^^^^^^^^^ @@ -69,13 +69,13 @@ note: inside `VaList::<'_>::next_arg::` --> $SRC_DIR/core/src/ffi/va_list.rs:LL:COL note: erroneous constant encountered - --> $DIR/c-variadic-fail.rs:50:5 + --> $DIR/c-variadic-fail.rs:49:5 | LL | const { read_as::(1i32) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: erroneous constant encountered - --> $DIR/c-variadic-fail.rs:50:5 + --> $DIR/c-variadic-fail.rs:49:5 | LL | const { read_as::(1i32) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -83,13 +83,13 @@ LL | const { read_as::(1i32) }; = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0080]: va_arg type mismatch: requested `i32`, but next argument is `u32` - --> $DIR/c-variadic-fail.rs:53:13 + --> $DIR/c-variadic-fail.rs:52:13 | LL | const { read_as::(1u32) }; | ^^^^^^^^^^^^^^^^^^^^ evaluation of `read_cast::{constant#7}` failed inside this call | note: inside `read_as::` - --> $DIR/c-variadic-fail.rs:37:5 + --> $DIR/c-variadic-fail.rs:36:5 | LL | ap.next_arg::() | ^^^^^^^^^^^^^^^^^^ @@ -97,13 +97,13 @@ note: inside `VaList::<'_>::next_arg::` --> $SRC_DIR/core/src/ffi/va_list.rs:LL:COL note: erroneous constant encountered - --> $DIR/c-variadic-fail.rs:53:5 + --> $DIR/c-variadic-fail.rs:52:5 | LL | const { read_as::(1u32) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: erroneous constant encountered - --> $DIR/c-variadic-fail.rs:53:5 + --> $DIR/c-variadic-fail.rs:52:5 | LL | const { read_as::(1u32) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -111,13 +111,13 @@ LL | const { read_as::(1u32) }; = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0080]: va_arg type mismatch: requested `i32`, but next argument is `u64` - --> $DIR/c-variadic-fail.rs:56:13 + --> $DIR/c-variadic-fail.rs:55:13 | LL | const { read_as::(1u64) }; | ^^^^^^^^^^^^^^^^^^^^ evaluation of `read_cast::{constant#8}` failed inside this call | note: inside `read_as::` - --> $DIR/c-variadic-fail.rs:37:5 + --> $DIR/c-variadic-fail.rs:36:5 | LL | ap.next_arg::() | ^^^^^^^^^^^^^^^^^^ @@ -125,13 +125,13 @@ note: inside `VaList::<'_>::next_arg::` --> $SRC_DIR/core/src/ffi/va_list.rs:LL:COL note: erroneous constant encountered - --> $DIR/c-variadic-fail.rs:56:5 + --> $DIR/c-variadic-fail.rs:55:5 | LL | const { read_as::(1u64) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: erroneous constant encountered - --> $DIR/c-variadic-fail.rs:56:5 + --> $DIR/c-variadic-fail.rs:55:5 | LL | const { read_as::(1u64) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -139,13 +139,13 @@ LL | const { read_as::(1u64) }; = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0080]: va_arg type mismatch: requested `f64`, but next argument is `i32` - --> $DIR/c-variadic-fail.rs:59:13 + --> $DIR/c-variadic-fail.rs:58:13 | LL | const { read_as::(1i32) }; | ^^^^^^^^^^^^^^^^^^^^ evaluation of `read_cast::{constant#9}` failed inside this call | note: inside `read_as::` - --> $DIR/c-variadic-fail.rs:37:5 + --> $DIR/c-variadic-fail.rs:36:5 | LL | ap.next_arg::() | ^^^^^^^^^^^^^^^^^^ @@ -153,13 +153,13 @@ note: inside `VaList::<'_>::next_arg::` --> $SRC_DIR/core/src/ffi/va_list.rs:LL:COL note: erroneous constant encountered - --> $DIR/c-variadic-fail.rs:59:5 + --> $DIR/c-variadic-fail.rs:58:5 | LL | const { read_as::(1i32) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: erroneous constant encountered - --> $DIR/c-variadic-fail.rs:59:5 + --> $DIR/c-variadic-fail.rs:58:5 | LL | const { read_as::(1i32) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -167,13 +167,13 @@ LL | const { read_as::(1i32) }; = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0080]: va_arg type mismatch: requested `*const u8`, but next argument is `i32` - --> $DIR/c-variadic-fail.rs:62:13 + --> $DIR/c-variadic-fail.rs:61:13 | LL | const { read_as::<*const u8>(1i32) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `read_cast::{constant#10}` failed inside this call | note: inside `read_as::<*const u8>` - --> $DIR/c-variadic-fail.rs:37:5 + --> $DIR/c-variadic-fail.rs:36:5 | LL | ap.next_arg::() | ^^^^^^^^^^^^^^^^^^ @@ -181,13 +181,13 @@ note: inside `VaList::<'_>::next_arg::<*const u8>` --> $SRC_DIR/core/src/ffi/va_list.rs:LL:COL note: erroneous constant encountered - --> $DIR/c-variadic-fail.rs:62:5 + --> $DIR/c-variadic-fail.rs:61:5 | LL | const { read_as::<*const u8>(1i32) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: erroneous constant encountered - --> $DIR/c-variadic-fail.rs:62:5 + --> $DIR/c-variadic-fail.rs:61:5 | LL | const { read_as::<*const u8>(1i32) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -195,7 +195,7 @@ LL | const { read_as::<*const u8>(1i32) }; = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0080]: memory access failed: ALLOC0 has been freed, so this pointer is dangling - --> $DIR/c-variadic-fail.rs:75:13 + --> $DIR/c-variadic-fail.rs:74:13 | LL | ap.next_arg::(); | ^^^^^^^^^^^^^^^^^^^^ evaluation of `use_after_free::{constant#0}` failed inside this call @@ -204,7 +204,7 @@ note: inside `VaList::<'_>::next_arg::` --> $SRC_DIR/core/src/ffi/va_list.rs:LL:COL note: erroneous constant encountered - --> $DIR/c-variadic-fail.rs:71:5 + --> $DIR/c-variadic-fail.rs:70:5 | LL | / const { LL | | unsafe { @@ -215,7 +215,7 @@ LL | | }; | |_____^ note: erroneous constant encountered - --> $DIR/c-variadic-fail.rs:71:5 + --> $DIR/c-variadic-fail.rs:70:5 | LL | / const { LL | | unsafe { @@ -228,13 +228,13 @@ LL | | }; = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0080]: using ALLOC1 as variable argument list pointer but it does not point to a variable argument list - --> $DIR/c-variadic-fail.rs:97:22 + --> $DIR/c-variadic-fail.rs:96:22 | LL | const { unsafe { helper(1, 2, 3) } }; | ^^^^^^^^^^^^^^^ evaluation of `manual_copy_drop::{constant#0}` failed inside this call | note: inside `manual_copy_drop::helper` - --> $DIR/c-variadic-fail.rs:94:9 + --> $DIR/c-variadic-fail.rs:93:9 | LL | drop(ap); | ^^^^^^^^ @@ -246,13 +246,13 @@ note: inside ` as Drop>::drop` --> $SRC_DIR/core/src/ffi/va_list.rs:LL:COL note: erroneous constant encountered - --> $DIR/c-variadic-fail.rs:97:5 + --> $DIR/c-variadic-fail.rs:96:5 | LL | const { unsafe { helper(1, 2, 3) } }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: erroneous constant encountered - --> $DIR/c-variadic-fail.rs:97:5 + --> $DIR/c-variadic-fail.rs:96:5 | LL | const { unsafe { helper(1, 2, 3) } }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -260,13 +260,13 @@ LL | const { unsafe { helper(1, 2, 3) } }; = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0080]: using ALLOC2 as variable argument list pointer but it does not point to a variable argument list - --> $DIR/c-variadic-fail.rs:113:22 + --> $DIR/c-variadic-fail.rs:112:22 | LL | const { unsafe { helper(1, 2, 3) } }; | ^^^^^^^^^^^^^^^ evaluation of `manual_copy_forget::{constant#0}` failed inside this call | note: inside `manual_copy_forget::helper` - --> $DIR/c-variadic-fail.rs:110:9 + --> $DIR/c-variadic-fail.rs:109:9 | LL | drop(ap); | ^^^^^^^^ @@ -278,13 +278,13 @@ note: inside ` as Drop>::drop` --> $SRC_DIR/core/src/ffi/va_list.rs:LL:COL note: erroneous constant encountered - --> $DIR/c-variadic-fail.rs:113:5 + --> $DIR/c-variadic-fail.rs:112:5 | LL | const { unsafe { helper(1, 2, 3) } }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: erroneous constant encountered - --> $DIR/c-variadic-fail.rs:113:5 + --> $DIR/c-variadic-fail.rs:112:5 | LL | const { unsafe { helper(1, 2, 3) } }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -292,13 +292,13 @@ LL | const { unsafe { helper(1, 2, 3) } }; = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0080]: using ALLOC3 as variable argument list pointer but it does not point to a variable argument list - --> $DIR/c-variadic-fail.rs:126:22 + --> $DIR/c-variadic-fail.rs:125:22 | LL | const { unsafe { helper(1, 2, 3) } }; | ^^^^^^^^^^^^^^^ evaluation of `manual_copy_read::{constant#0}` failed inside this call | note: inside `manual_copy_read::helper` - --> $DIR/c-variadic-fail.rs:123:17 + --> $DIR/c-variadic-fail.rs:122:17 | LL | let _ = ap.next_arg::(); | ^^^^^^^^^^^^^^^^^^^^ @@ -306,13 +306,13 @@ note: inside `VaList::<'_>::next_arg::` --> $SRC_DIR/core/src/ffi/va_list.rs:LL:COL note: erroneous constant encountered - --> $DIR/c-variadic-fail.rs:126:5 + --> $DIR/c-variadic-fail.rs:125:5 | LL | const { unsafe { helper(1, 2, 3) } }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: erroneous constant encountered - --> $DIR/c-variadic-fail.rs:126:5 + --> $DIR/c-variadic-fail.rs:125:5 | LL | const { unsafe { helper(1, 2, 3) } }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -320,7 +320,7 @@ LL | const { unsafe { helper(1, 2, 3) } }; = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error[E0080]: pointer not dereferenceable: pointer must point to some allocation, but got null pointer - --> $DIR/c-variadic-fail.rs:134:5 + --> $DIR/c-variadic-fail.rs:133:5 | LL | } | ^ evaluation of `drop_of_invalid::{constant#0}` failed inside this call @@ -331,7 +331,7 @@ note: inside ` as Drop>::drop` --> $SRC_DIR/core/src/ffi/va_list.rs:LL:COL note: erroneous constant encountered - --> $DIR/c-variadic-fail.rs:131:5 + --> $DIR/c-variadic-fail.rs:130:5 | LL | / const { LL | | let mut invalid: MaybeUninit = MaybeUninit::zeroed(); @@ -340,7 +340,7 @@ LL | | } | |_____^ note: erroneous constant encountered - --> $DIR/c-variadic-fail.rs:131:5 + --> $DIR/c-variadic-fail.rs:130:5 | LL | / const { LL | | let mut invalid: MaybeUninit = MaybeUninit::zeroed(); diff --git a/tests/ui/consts/const-eval/c-variadic-ignored-argument.rs b/tests/ui/consts/const-eval/c-variadic-ignored-argument.rs index fe700eea186e0..506d6ad5fee23 100644 --- a/tests/ui/consts/const-eval/c-variadic-ignored-argument.rs +++ b/tests/ui/consts/const-eval/c-variadic-ignored-argument.rs @@ -1,6 +1,5 @@ //@ build-pass //@ compile-flags: --emit=obj -#![feature(c_variadic)] #![feature(const_c_variadic)] #![feature(const_destruct)] #![crate_type = "lib"] diff --git a/tests/ui/consts/const-eval/c-variadic.rs b/tests/ui/consts/const-eval/c-variadic.rs index b8f02ea8a0848..6dba6e1af5997 100644 --- a/tests/ui/consts/const-eval/c-variadic.rs +++ b/tests/ui/consts/const-eval/c-variadic.rs @@ -2,7 +2,6 @@ //@ run-pass //@ ignore-backends: gcc -#![feature(c_variadic)] #![feature(const_c_variadic)] #![feature(const_destruct)] #![feature(const_cmp)] diff --git a/tests/ui/delegation/auxiliary/fn-header-aux.rs b/tests/ui/delegation/auxiliary/fn-header-aux.rs index d26209a4f789f..82ac8ed9d65d4 100644 --- a/tests/ui/delegation/auxiliary/fn-header-aux.rs +++ b/tests/ui/delegation/auxiliary/fn-header-aux.rs @@ -1,7 +1,5 @@ //@ edition:2018 -#![feature(c_variadic)] - pub unsafe fn unsafe_fn_extern() {} pub extern "C" fn extern_fn_extern() {} pub unsafe extern "C" fn variadic_fn_extern(n: usize, mut args: ...) {} diff --git a/tests/ui/delegation/fn-header-variadic.rs b/tests/ui/delegation/fn-header-variadic.rs index b5056f48a9be4..051be3a51502d 100644 --- a/tests/ui/delegation/fn-header-variadic.rs +++ b/tests/ui/delegation/fn-header-variadic.rs @@ -1,7 +1,6 @@ //@ aux-crate:fn_header_aux=fn-header-aux.rs //@ ignore-backends: gcc -#![feature(c_variadic)] #![feature(fn_delegation)] mod to_reuse { diff --git a/tests/ui/delegation/fn-header-variadic.stderr b/tests/ui/delegation/fn-header-variadic.stderr index 688a965fb4d5c..a0b5a6313d080 100644 --- a/tests/ui/delegation/fn-header-variadic.stderr +++ b/tests/ui/delegation/fn-header-variadic.stderr @@ -1,5 +1,5 @@ error: delegation to C-variadic functions is not allowed - --> $DIR/fn-header-variadic.rs:11:17 + --> $DIR/fn-header-variadic.rs:10:17 | LL | pub unsafe extern "C" fn variadic_fn(n: usize, mut args: ...) {} | ------------------------------------------------------------- callee defined here @@ -8,12 +8,12 @@ LL | reuse to_reuse::variadic_fn; | ^^^^^^^^^^^ error: delegation to C-variadic functions is not allowed - --> $DIR/fn-header-variadic.rs:13:22 + --> $DIR/fn-header-variadic.rs:12:22 | LL | reuse fn_header_aux::variadic_fn_extern; | ^^^^^^^^^^^^^^^^^^ | - ::: $DIR/auxiliary/fn-header-aux.rs:7:1 + ::: $DIR/auxiliary/fn-header-aux.rs:5:1 | LL | pub unsafe extern "C" fn variadic_fn_extern(n: usize, mut args: ...) {} | -------------------------------------------------------------------- callee defined here diff --git a/tests/ui/delegation/fn-header.rs b/tests/ui/delegation/fn-header.rs index d3fb6fb88ed59..16e3c10136ce0 100644 --- a/tests/ui/delegation/fn-header.rs +++ b/tests/ui/delegation/fn-header.rs @@ -3,7 +3,6 @@ //@ aux-crate:fn_header_aux=fn-header-aux.rs //@ ignore-backends: gcc -#![feature(c_variadic)] #![feature(fn_delegation)] #![deny(unused_unsafe)] diff --git a/tests/ui/delegation/unsupported.current.stderr b/tests/ui/delegation/unsupported.current.stderr index 21ea451a2ea5c..4484ba7489803 100644 --- a/tests/ui/delegation/unsupported.current.stderr +++ b/tests/ui/delegation/unsupported.current.stderr @@ -1,36 +1,36 @@ -error[E0391]: cycle detected when computing type of `opaque::::opaque_ret::{anon_assoc#0}` - --> $DIR/unsupported.rs:29:25 +error[E0391]: cycle detected when computing type of `opaque::::opaque_ret::{anon_assoc#0}` + --> $DIR/unsupported.rs:28:25 | LL | reuse to_reuse::opaque_ret; | ^^^^^^^^^^ | note: ...which requires comparing an impl and trait method signature, inferring any hidden `impl Trait` types in the process... - --> $DIR/unsupported.rs:29:25 + --> $DIR/unsupported.rs:28:25 | LL | reuse to_reuse::opaque_ret; | ^^^^^^^^^^ - = note: ...which again requires computing type of `opaque::::opaque_ret::{anon_assoc#0}`, completing the cycle -note: cycle used when checking assoc item `opaque::::opaque_ret` is compatible with trait definition - --> $DIR/unsupported.rs:29:25 + = note: ...which again requires computing type of `opaque::::opaque_ret::{anon_assoc#0}`, completing the cycle +note: cycle used when checking assoc item `opaque::::opaque_ret` is compatible with trait definition + --> $DIR/unsupported.rs:28:25 | LL | reuse to_reuse::opaque_ret; | ^^^^^^^^^^ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information -error[E0391]: cycle detected when computing type of `opaque::::opaque_ret::{anon_assoc#0}` - --> $DIR/unsupported.rs:32:24 +error[E0391]: cycle detected when computing type of `opaque::::opaque_ret::{anon_assoc#0}` + --> $DIR/unsupported.rs:31:24 | LL | reuse ToReuse::opaque_ret; | ^^^^^^^^^^ | note: ...which requires comparing an impl and trait method signature, inferring any hidden `impl Trait` types in the process... - --> $DIR/unsupported.rs:32:24 + --> $DIR/unsupported.rs:31:24 | LL | reuse ToReuse::opaque_ret; | ^^^^^^^^^^ - = note: ...which again requires computing type of `opaque::::opaque_ret::{anon_assoc#0}`, completing the cycle -note: cycle used when checking assoc item `opaque::::opaque_ret` is compatible with trait definition - --> $DIR/unsupported.rs:32:24 + = note: ...which again requires computing type of `opaque::::opaque_ret::{anon_assoc#0}`, completing the cycle +note: cycle used when checking assoc item `opaque::::opaque_ret` is compatible with trait definition + --> $DIR/unsupported.rs:31:24 | LL | reuse ToReuse::opaque_ret; | ^^^^^^^^^^ diff --git a/tests/ui/delegation/unsupported.next.stderr b/tests/ui/delegation/unsupported.next.stderr index 82569be1a7bae..bba38e68c1813 100644 --- a/tests/ui/delegation/unsupported.next.stderr +++ b/tests/ui/delegation/unsupported.next.stderr @@ -1,30 +1,30 @@ -error[E0391]: cycle detected when computing type of `opaque::::opaque_ret::{anon_assoc#0}` - --> $DIR/unsupported.rs:29:25 +error[E0391]: cycle detected when computing type of `opaque::::opaque_ret::{anon_assoc#0}` + --> $DIR/unsupported.rs:28:25 | LL | reuse to_reuse::opaque_ret; | ^^^^^^^^^^ | note: ...which requires comparing an impl and trait method signature, inferring any hidden `impl Trait` types in the process... - --> $DIR/unsupported.rs:29:25 + --> $DIR/unsupported.rs:28:25 | LL | reuse to_reuse::opaque_ret; | ^^^^^^^^^^ - = note: ...which again requires computing type of `opaque::::opaque_ret::{anon_assoc#0}`, completing the cycle + = note: ...which again requires computing type of `opaque::::opaque_ret::{anon_assoc#0}`, completing the cycle = note: cycle used when computing implied outlives bounds for `::opaque_ret::{anon_assoc#0}` (hack disabled = false) = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information -error[E0391]: cycle detected when computing type of `opaque::::opaque_ret::{anon_assoc#0}` - --> $DIR/unsupported.rs:32:24 +error[E0391]: cycle detected when computing type of `opaque::::opaque_ret::{anon_assoc#0}` + --> $DIR/unsupported.rs:31:24 | LL | reuse ToReuse::opaque_ret; | ^^^^^^^^^^ | note: ...which requires comparing an impl and trait method signature, inferring any hidden `impl Trait` types in the process... - --> $DIR/unsupported.rs:32:24 + --> $DIR/unsupported.rs:31:24 | LL | reuse ToReuse::opaque_ret; | ^^^^^^^^^^ - = note: ...which again requires computing type of `opaque::::opaque_ret::{anon_assoc#0}`, completing the cycle + = note: ...which again requires computing type of `opaque::::opaque_ret::{anon_assoc#0}`, completing the cycle = note: cycle used when computing implied outlives bounds for `::opaque_ret::{anon_assoc#0}` (hack disabled = false) = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information diff --git a/tests/ui/delegation/unsupported.rs b/tests/ui/delegation/unsupported.rs index 678c93dcd53c0..ddc0e5c6cbb7b 100644 --- a/tests/ui/delegation/unsupported.rs +++ b/tests/ui/delegation/unsupported.rs @@ -7,7 +7,6 @@ // If we end up in a query cycle, it should be okay as long as results are the same. #![feature(const_trait_impl)] -#![feature(c_variadic)] #![feature(fn_delegation)] mod opaque { diff --git a/tests/ui/explicit-tail-calls/c-variadic.rs b/tests/ui/explicit-tail-calls/c-variadic.rs index affe90c606526..c4bbf5956fc3d 100644 --- a/tests/ui/explicit-tail-calls/c-variadic.rs +++ b/tests/ui/explicit-tail-calls/c-variadic.rs @@ -1,5 +1,5 @@ #![expect(incomplete_features)] -#![feature(c_variadic, explicit_tail_calls)] +#![feature(explicit_tail_calls)] #![allow(unused)] unsafe extern "C" fn foo(mut ap: ...) -> u32 { diff --git a/tests/ui/explicit-tail-calls/signature-mismatch.rs b/tests/ui/explicit-tail-calls/signature-mismatch.rs index a32ac9d8bfee3..338c40e93f3f6 100644 --- a/tests/ui/explicit-tail-calls/signature-mismatch.rs +++ b/tests/ui/explicit-tail-calls/signature-mismatch.rs @@ -1,6 +1,5 @@ #![expect(incomplete_features)] #![feature(explicit_tail_calls)] -#![feature(c_variadic)] fn _f0((): ()) { become _g0(); //~ error: mismatched signatures @@ -8,26 +7,22 @@ fn _f0((): ()) { fn _g0() {} - fn _f1() { become _g1(()); //~ error: mismatched signatures } fn _g1((): ()) {} - extern "C" fn _f2() { become _g2(); //~ error: mismatched function ABIs } fn _g2() {} - fn _f3() { become _g3(); //~ error: mismatched function ABIs } extern "C" fn _g3() {} - fn main() {} diff --git a/tests/ui/explicit-tail-calls/signature-mismatch.stderr b/tests/ui/explicit-tail-calls/signature-mismatch.stderr index ba9e9dcb98483..5847114a193eb 100644 --- a/tests/ui/explicit-tail-calls/signature-mismatch.stderr +++ b/tests/ui/explicit-tail-calls/signature-mismatch.stderr @@ -1,5 +1,5 @@ error: mismatched signatures - --> $DIR/signature-mismatch.rs:6:5 + --> $DIR/signature-mismatch.rs:5:5 | LL | become _g0(); | ^^^^^^^^^^^^ @@ -9,7 +9,7 @@ LL | become _g0(); = note: callee signature: `fn()` error: mismatched signatures - --> $DIR/signature-mismatch.rs:13:5 + --> $DIR/signature-mismatch.rs:11:5 | LL | become _g1(()); | ^^^^^^^^^^^^^^ @@ -19,7 +19,7 @@ LL | become _g1(()); = note: callee signature: `fn(())` error: mismatched function ABIs - --> $DIR/signature-mismatch.rs:20:5 + --> $DIR/signature-mismatch.rs:17:5 | LL | become _g2(); | ^^^^^^^^^^^^ @@ -28,7 +28,7 @@ LL | become _g2(); = note: caller ABI is `"C"`, while callee ABI is `"Rust"` error: mismatched function ABIs - --> $DIR/signature-mismatch.rs:27:5 + --> $DIR/signature-mismatch.rs:23:5 | LL | become _g3(); | ^^^^^^^^^^^^ diff --git a/tests/ui/feature-gates/feature-gate-c_variadic-naked-functions.rs b/tests/ui/feature-gates/feature-gate-c_variadic-naked-functions.rs index bf52c4d0cf526..1fc0ac4198937 100644 --- a/tests/ui/feature-gates/feature-gate-c_variadic-naked-functions.rs +++ b/tests/ui/feature-gates/feature-gate-c_variadic-naked-functions.rs @@ -4,7 +4,7 @@ //@ ignore-backends: gcc #![feature(no_core, lang_items, rustc_attrs)] -#![feature(c_variadic, abi_x86_interrupt, naked_functions_rustic_abi)] +#![feature(abi_x86_interrupt, naked_functions_rustic_abi)] #![crate_type = "rlib"] #![no_core] diff --git a/tests/ui/feature-gates/feature-gate-c_variadic.rs b/tests/ui/feature-gates/feature-gate-c_variadic.rs deleted file mode 100644 index 649816b48d784..0000000000000 --- a/tests/ui/feature-gates/feature-gate-c_variadic.rs +++ /dev/null @@ -1,9 +0,0 @@ -#![crate_type = "lib"] - -pub unsafe extern "C" fn test(_: i32, ap: ...) {} -//~^ ERROR C-variadic functions are unstable - -trait Trait { - unsafe extern "C" fn trait_test(_: i32, ap: ...) {} - //~^ ERROR C-variadic functions are unstable -} diff --git a/tests/ui/feature-gates/feature-gate-c_variadic.stderr b/tests/ui/feature-gates/feature-gate-c_variadic.stderr deleted file mode 100644 index ae880093b980c..0000000000000 --- a/tests/ui/feature-gates/feature-gate-c_variadic.stderr +++ /dev/null @@ -1,23 +0,0 @@ -error[E0658]: C-variadic functions are unstable - --> $DIR/feature-gate-c_variadic.rs:3:1 - | -LL | pub unsafe extern "C" fn test(_: i32, ap: ...) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #44930 for more information - = help: add `#![feature(c_variadic)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: C-variadic functions are unstable - --> $DIR/feature-gate-c_variadic.rs:7:5 - | -LL | unsafe extern "C" fn trait_test(_: i32, ap: ...) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #44930 for more information - = help: add `#![feature(c_variadic)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/feature-gates/feature-gate-const-c-variadic.rs b/tests/ui/feature-gates/feature-gate-const-c-variadic.rs index 4e8b3c54b1fd1..efb2e3d4b8ece 100644 --- a/tests/ui/feature-gates/feature-gate-const-c-variadic.rs +++ b/tests/ui/feature-gates/feature-gate-const-c-variadic.rs @@ -1,5 +1,3 @@ -#![feature(c_variadic)] - fn main() { const unsafe extern "C" fn foo(ap: ...) { //~^ ERROR c-variadic const function definitions are unstable diff --git a/tests/ui/feature-gates/feature-gate-const-c-variadic.stderr b/tests/ui/feature-gates/feature-gate-const-c-variadic.stderr index 8fd85be08fca4..43bdfbcb3e250 100644 --- a/tests/ui/feature-gates/feature-gate-const-c-variadic.stderr +++ b/tests/ui/feature-gates/feature-gate-const-c-variadic.stderr @@ -1,5 +1,5 @@ error[E0658]: c-variadic const function definitions are unstable - --> $DIR/feature-gate-const-c-variadic.rs:4:5 + --> $DIR/feature-gate-const-c-variadic.rs:2:5 | LL | const unsafe extern "C" fn foo(ap: ...) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -9,7 +9,7 @@ LL | const unsafe extern "C" fn foo(ap: ...) { = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0015]: calling const c-variadic functions is unstable in constants - --> $DIR/feature-gate-const-c-variadic.rs:9:22 + --> $DIR/feature-gate-const-c-variadic.rs:7:22 | LL | const { unsafe { foo() } } | ^^^^^ diff --git a/tests/ui/force-inlining/early-deny.rs b/tests/ui/force-inlining/early-deny.rs index 99b03a4e0e2ce..ca45c2c4c0cc1 100644 --- a/tests/ui/force-inlining/early-deny.rs +++ b/tests/ui/force-inlining/early-deny.rs @@ -1,21 +1,17 @@ //@ check-fail //@ compile-flags: --crate-type=lib -#![feature(c_variadic)] #![feature(rustc_attrs)] #[rustc_no_mir_inline] #[rustc_force_inline] //~^ ERROR `rustc_attr` is incompatible with `#[rustc_force_inline]` -pub fn rustc_attr() { -} +pub fn rustc_attr() {} #[cold] #[rustc_force_inline] //~^ ERROR `cold` is incompatible with `#[rustc_force_inline]` -pub fn cold() { -} +pub fn cold() {} #[rustc_force_inline] //~^ ERROR `variadic` is incompatible with `#[rustc_force_inline]` -pub unsafe extern "C" fn variadic(args: ...) { -} +pub unsafe extern "C" fn variadic(args: ...) {} diff --git a/tests/ui/force-inlining/early-deny.stderr b/tests/ui/force-inlining/early-deny.stderr index abee66fd293c6..53d9e09d5e616 100644 --- a/tests/ui/force-inlining/early-deny.stderr +++ b/tests/ui/force-inlining/early-deny.stderr @@ -1,32 +1,32 @@ error: `rustc_attr` is incompatible with `#[rustc_force_inline]` - --> $DIR/early-deny.rs:7:1 + --> $DIR/early-deny.rs:6:1 | LL | #[rustc_force_inline] | ^^^^^^^^^^^^^^^^^^^^^ LL | -LL | pub fn rustc_attr() { +LL | pub fn rustc_attr() {} | ------------------- `rustc_attr` defined here | = note: incompatible due to: #[rustc_no_mir_inline] error: `cold` is incompatible with `#[rustc_force_inline]` - --> $DIR/early-deny.rs:13:1 + --> $DIR/early-deny.rs:11:1 | LL | #[rustc_force_inline] | ^^^^^^^^^^^^^^^^^^^^^ LL | -LL | pub fn cold() { +LL | pub fn cold() {} | ------------- `cold` defined here | = note: incompatible due to: cold error: `variadic` is incompatible with `#[rustc_force_inline]` - --> $DIR/early-deny.rs:18:1 + --> $DIR/early-deny.rs:15:1 | LL | #[rustc_force_inline] | ^^^^^^^^^^^^^^^^^^^^^ LL | -LL | pub unsafe extern "C" fn variadic(args: ...) { +LL | pub unsafe extern "C" fn variadic(args: ...) {} | -------------------------------------------- `variadic` defined here | = note: incompatible due to: C variadic diff --git a/tests/ui/inference/note-and-explain-ReVar-124973.rs b/tests/ui/inference/note-and-explain-ReVar-124973.rs index 8c04648d57b2d..ff68c53c0f028 100644 --- a/tests/ui/inference/note-and-explain-ReVar-124973.rs +++ b/tests/ui/inference/note-and-explain-ReVar-124973.rs @@ -1,7 +1,5 @@ //@ edition:2018 -#![feature(c_variadic)] - async unsafe extern "C" fn multiple_named_lifetimes<'a, 'b>(_: u8, _: ...) {} //~^ ERROR functions cannot be both `async` and C-variadic //~| ERROR hidden type for `impl Future` captures lifetime that does not appear in bounds diff --git a/tests/ui/inference/note-and-explain-ReVar-124973.stderr b/tests/ui/inference/note-and-explain-ReVar-124973.stderr index 2b5e79e9a1c64..3610fa82754b9 100644 --- a/tests/ui/inference/note-and-explain-ReVar-124973.stderr +++ b/tests/ui/inference/note-and-explain-ReVar-124973.stderr @@ -1,11 +1,11 @@ error: functions cannot be both `async` and C-variadic - --> $DIR/note-and-explain-ReVar-124973.rs:5:1 + --> $DIR/note-and-explain-ReVar-124973.rs:3:1 | LL | async unsafe extern "C" fn multiple_named_lifetimes<'a, 'b>(_: u8, _: ...) {} | ^^^^^ `async` because of this ^^^^^^ C-variadic because of this error[E0700]: hidden type for `impl Future` captures lifetime that does not appear in bounds - --> $DIR/note-and-explain-ReVar-124973.rs:5:76 + --> $DIR/note-and-explain-ReVar-124973.rs:3:76 | LL | async unsafe extern "C" fn multiple_named_lifetimes<'a, 'b>(_: u8, _: ...) {} | -^^ diff --git a/tests/ui/lint/function-item-references.rs b/tests/ui/lint/function-item-references.rs index 4f2fc4de8632e..5afd8341473f3 100644 --- a/tests/ui/lint/function-item-references.rs +++ b/tests/ui/lint/function-item-references.rs @@ -1,5 +1,6 @@ //@ check-pass -#![feature(c_variadic)] +#![feature(custom_inner_attributes)] // for top-level rustfmt::skip +#![rustfmt::skip] #![warn(function_item_references)] use std::fmt::Pointer; use std::fmt::Formatter; diff --git a/tests/ui/lint/function-item-references.stderr b/tests/ui/lint/function-item-references.stderr index a9d18bb6a4743..837a4b2087fdf 100644 --- a/tests/ui/lint/function-item-references.stderr +++ b/tests/ui/lint/function-item-references.stderr @@ -1,203 +1,203 @@ warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:44:18 + --> $DIR/function-item-references.rs:45:18 | LL | Pointer::fmt(&zst_ref, f) | ^^^^^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _` | note: the lint level is defined here - --> $DIR/function-item-references.rs:3:9 + --> $DIR/function-item-references.rs:4:9 | LL | #![warn(function_item_references)] | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:81:22 + --> $DIR/function-item-references.rs:82:22 | LL | println!("{:p}", &foo); | ^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:83:20 + --> $DIR/function-item-references.rs:84:20 | LL | print!("{:p}", &foo); | ^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:85:21 + --> $DIR/function-item-references.rs:86:21 | LL | format!("{:p}", &foo); | ^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:88:22 + --> $DIR/function-item-references.rs:89:22 | LL | println!("{:p}", &foo as *const _); | ^^^^^^^^^^^^^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:90:22 + --> $DIR/function-item-references.rs:91:22 | LL | println!("{:p}", zst_ref); | ^^^^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:92:22 + --> $DIR/function-item-references.rs:93:22 | LL | println!("{:p}", cast_zst_ptr); | ^^^^^^^^^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:94:22 + --> $DIR/function-item-references.rs:95:22 | LL | println!("{:p}", coerced_zst_ptr); | ^^^^^^^^^^^^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:97:22 + --> $DIR/function-item-references.rs:98:22 | LL | println!("{:p}", &fn_item); | ^^^^^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:99:22 + --> $DIR/function-item-references.rs:100:22 | LL | println!("{:p}", indirect_ref); | ^^^^^^^^^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:102:22 + --> $DIR/function-item-references.rs:103:22 | LL | println!("{:p}", &nop); | ^^^^ help: cast `nop` to obtain a function pointer: `nop as fn()` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:104:22 + --> $DIR/function-item-references.rs:105:22 | LL | println!("{:p}", &bar); | ^^^^ help: cast `bar` to obtain a function pointer: `bar as fn(_) -> _` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:106:22 + --> $DIR/function-item-references.rs:107:22 | LL | println!("{:p}", &baz); | ^^^^ help: cast `baz` to obtain a function pointer: `baz as fn(_, _) -> _` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:108:22 + --> $DIR/function-item-references.rs:109:22 | LL | println!("{:p}", &unsafe_fn); | ^^^^^^^^^^ help: cast `unsafe_fn` to obtain a function pointer: `unsafe_fn as unsafe fn()` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:110:22 + --> $DIR/function-item-references.rs:111:22 | LL | println!("{:p}", &c_fn); | ^^^^^ help: cast `c_fn` to obtain a function pointer: `c_fn as extern "C" fn()` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:112:22 + --> $DIR/function-item-references.rs:113:22 | LL | println!("{:p}", &unsafe_c_fn); | ^^^^^^^^^^^^ help: cast `unsafe_c_fn` to obtain a function pointer: `unsafe_c_fn as unsafe extern "C" fn()` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:114:22 + --> $DIR/function-item-references.rs:115:22 | LL | println!("{:p}", &variadic); | ^^^^^^^^^ help: cast `variadic` to obtain a function pointer: `variadic as unsafe extern "C" fn(_, ...)` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:116:22 + --> $DIR/function-item-references.rs:117:22 | LL | println!("{:p}", &take_generic_ref::); | ^^^^^^^^^^^^^^^^^^^^^^^^ help: cast `take_generic_ref` to obtain a function pointer: `take_generic_ref:: as fn(_)` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:118:22 + --> $DIR/function-item-references.rs:119:22 | LL | println!("{:p}", &take_generic_array::); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: cast `take_generic_array` to obtain a function pointer: `take_generic_array:: as fn(_)` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:120:22 + --> $DIR/function-item-references.rs:121:22 | LL | println!("{:p}", &multiple_generic::); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: cast `multiple_generic` to obtain a function pointer: `multiple_generic:: as fn(_, _)` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:122:22 + --> $DIR/function-item-references.rs:123:22 | LL | println!("{:p}", &multiple_generic_arrays::); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: cast `multiple_generic_arrays` to obtain a function pointer: `multiple_generic_arrays:: as fn(_, _)` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:124:22 + --> $DIR/function-item-references.rs:125:22 | LL | println!("{:p}", &std::env::var::); | ^^^^^^^^^^^^^^^^^^^^^^^^ help: cast `var` to obtain a function pointer: `var:: as fn(_) -> _` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:127:32 + --> $DIR/function-item-references.rs:128:32 | LL | println!("{:p} {:p} {:p}", &nop, &foo, &bar); | ^^^^ help: cast `nop` to obtain a function pointer: `nop as fn()` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:127:38 + --> $DIR/function-item-references.rs:128:38 | LL | println!("{:p} {:p} {:p}", &nop, &foo, &bar); | ^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:127:44 + --> $DIR/function-item-references.rs:128:44 | LL | println!("{:p} {:p} {:p}", &nop, &foo, &bar); | ^^^^ help: cast `bar` to obtain a function pointer: `bar as fn(_) -> _` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:142:41 + --> $DIR/function-item-references.rs:143:41 | LL | std::mem::transmute::<_, usize>(&foo); | ^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:144:50 + --> $DIR/function-item-references.rs:145:50 | LL | std::mem::transmute::<_, (usize, usize)>((&foo, &bar)); | ^^^^^^^^^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:144:50 + --> $DIR/function-item-references.rs:145:50 | LL | std::mem::transmute::<_, (usize, usize)>((&foo, &bar)); | ^^^^^^^^^^^^ help: cast `bar` to obtain a function pointer: `bar as fn(_) -> _` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:147:41 + --> $DIR/function-item-references.rs:148:41 | LL | std::mem::transmute::<_, usize>(&take_generic_ref::); | ^^^^^^^^^^^^^^^^^^^^^^^^ help: cast `take_generic_ref` to obtain a function pointer: `take_generic_ref:: as fn(_)` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:156:15 + --> $DIR/function-item-references.rs:157:15 | LL | print_ptr(&bar); | ^^^^ help: cast `bar` to obtain a function pointer: `bar as fn(_) -> _` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:158:24 + --> $DIR/function-item-references.rs:159:24 | LL | bound_by_ptr_trait(&bar); | ^^^^ help: cast `bar` to obtain a function pointer: `bar as fn(_) -> _` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:160:30 + --> $DIR/function-item-references.rs:161:30 | LL | bound_by_ptr_trait_tuple((&foo, &bar)); | ^^^^^^^^^^^^ help: cast `bar` to obtain a function pointer: `bar as fn(_) -> _` warning: taking a reference to a function item does not give a function pointer - --> $DIR/function-item-references.rs:160:30 + --> $DIR/function-item-references.rs:161:30 | LL | bound_by_ptr_trait_tuple((&foo, &bar)); | ^^^^^^^^^^^^ help: cast `foo` to obtain a function pointer: `foo as fn() -> _` 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 4c547356716c2..7ff04b4573a3a 100644 --- a/tests/ui/mir/issue-83499-input-output-iteration-ice.rs +++ b/tests/ui/mir/issue-83499-input-output-iteration-ice.rs @@ -1,7 +1,5 @@ // Test that when in MIR the amount of local_decls and amount of normalized_input_tys don't match // that an out-of-bounds access does not occur. -#![feature(c_variadic)] - fn main() {} unsafe extern "C" fn foo(_: Bar, _: ...) -> impl {} 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 2ce695ce79d93..c7a150763871e 100644 --- a/tests/ui/mir/issue-83499-input-output-iteration-ice.stderr +++ b/tests/ui/mir/issue-83499-input-output-iteration-ice.stderr @@ -1,11 +1,11 @@ error: at least one trait must be specified - --> $DIR/issue-83499-input-output-iteration-ice.rs:7:45 + --> $DIR/issue-83499-input-output-iteration-ice.rs:5:45 | LL | unsafe extern "C" fn foo(_: Bar, _: ...) -> impl {} | ^^^^ error[E0425]: cannot find type `Bar` in this scope - --> $DIR/issue-83499-input-output-iteration-ice.rs:7:29 + --> $DIR/issue-83499-input-output-iteration-ice.rs:5:29 | LL | unsafe extern "C" fn foo(_: Bar, _: ...) -> impl {} | ^^^ not found in this scope diff --git a/tests/ui/mismatched_types/mismatch-args-vargs-issue-130372.rs b/tests/ui/mismatched_types/mismatch-args-vargs-issue-130372.rs index 60a3b47010e29..a49a3ecd460e6 100644 --- a/tests/ui/mismatched_types/mismatch-args-vargs-issue-130372.rs +++ b/tests/ui/mismatched_types/mismatch-args-vargs-issue-130372.rs @@ -1,5 +1,3 @@ -#![feature(c_variadic)] - // Regression test that covers all 3 cases of https://github.com/rust-lang/rust/issues/130372 unsafe extern "C" fn test_va_copy(_: u64, mut ap: ...) {} diff --git a/tests/ui/mismatched_types/mismatch-args-vargs-issue-130372.stderr b/tests/ui/mismatched_types/mismatch-args-vargs-issue-130372.stderr index b949b4ea298ad..0771bcda65b36 100644 --- a/tests/ui/mismatched_types/mismatch-args-vargs-issue-130372.stderr +++ b/tests/ui/mismatched_types/mismatch-args-vargs-issue-130372.stderr @@ -1,11 +1,11 @@ error[E0060]: this function takes at least 1 argument but 0 arguments were supplied - --> $DIR/mismatch-args-vargs-issue-130372.rs:9:9 + --> $DIR/mismatch-args-vargs-issue-130372.rs:7:9 | LL | test_va_copy(); | ^^^^^^^^^^^^-- argument #1 of type `u64` is missing | note: function defined here - --> $DIR/mismatch-args-vargs-issue-130372.rs:5:22 + --> $DIR/mismatch-args-vargs-issue-130372.rs:3:22 | LL | unsafe extern "C" fn test_va_copy(_: u64, mut ap: ...) {} | ^^^^^^^^^^^^ ------ diff --git a/tests/ui/parser/variadic-ffi-semantic-restrictions.rs b/tests/ui/parser/variadic-ffi-semantic-restrictions.rs index 4e038875d78f8..170bd7a86253f 100644 --- a/tests/ui/parser/variadic-ffi-semantic-restrictions.rs +++ b/tests/ui/parser/variadic-ffi-semantic-restrictions.rs @@ -1,4 +1,3 @@ -#![feature(c_variadic)] #![allow(anonymous_parameters)] fn main() {} diff --git a/tests/ui/parser/variadic-ffi-semantic-restrictions.stderr b/tests/ui/parser/variadic-ffi-semantic-restrictions.stderr index ea9f9baa58ba2..0524423ccbd33 100644 --- a/tests/ui/parser/variadic-ffi-semantic-restrictions.stderr +++ b/tests/ui/parser/variadic-ffi-semantic-restrictions.stderr @@ -1,5 +1,5 @@ error: `...` is not supported for non-extern functions - --> $DIR/variadic-ffi-semantic-restrictions.rs:6:19 + --> $DIR/variadic-ffi-semantic-restrictions.rs:5:19 | LL | fn f1_1(x: isize, _: ...) {} | ^^^^^^ @@ -7,7 +7,7 @@ LL | fn f1_1(x: isize, _: ...) {} = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list error: `...` is not supported for non-extern functions - --> $DIR/variadic-ffi-semantic-restrictions.rs:9:9 + --> $DIR/variadic-ffi-semantic-restrictions.rs:8:9 | LL | fn f1_2(_: ...) {} | ^^^^^^ @@ -15,7 +15,7 @@ LL | fn f1_2(_: ...) {} = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list error: `...` is not supported for `extern "Rust"` functions - --> $DIR/variadic-ffi-semantic-restrictions.rs:12:30 + --> $DIR/variadic-ffi-semantic-restrictions.rs:11:30 | LL | unsafe extern "Rust" fn f1_3(_: ...) {} | ------------- ^^^^^^ @@ -25,7 +25,7 @@ LL | unsafe extern "Rust" fn f1_3(_: ...) {} = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list error: functions with a C variable argument list must be unsafe - --> $DIR/variadic-ffi-semantic-restrictions.rs:15:30 + --> $DIR/variadic-ffi-semantic-restrictions.rs:14:30 | LL | extern "C" fn f2_1(x: isize, _: ...) {} | ^^^^^^ @@ -36,7 +36,7 @@ LL | unsafe extern "C" fn f2_1(x: isize, _: ...) {} | ++++++ error: functions with a C variable argument list must be unsafe - --> $DIR/variadic-ffi-semantic-restrictions.rs:18:20 + --> $DIR/variadic-ffi-semantic-restrictions.rs:17:20 | LL | extern "C" fn f2_2(_: ...) {} | ^^^^^^ @@ -47,13 +47,13 @@ LL | unsafe extern "C" fn f2_2(_: ...) {} | ++++++ error: `...` must be the last argument of a C-variadic function - --> $DIR/variadic-ffi-semantic-restrictions.rs:21:20 + --> $DIR/variadic-ffi-semantic-restrictions.rs:20:20 | LL | extern "C" fn f2_3(_: ..., x: isize) {} | ^^^^^^ error: functions with a C variable argument list must be unsafe - --> $DIR/variadic-ffi-semantic-restrictions.rs:24:30 + --> $DIR/variadic-ffi-semantic-restrictions.rs:23:30 | LL | extern "C" fn f3_1(x: isize, _: ...) {} | ^^^^^^ @@ -64,7 +64,7 @@ LL | unsafe extern "C" fn f3_1(x: isize, _: ...) {} | ++++++ error: functions with a C variable argument list must be unsafe - --> $DIR/variadic-ffi-semantic-restrictions.rs:27:20 + --> $DIR/variadic-ffi-semantic-restrictions.rs:26:20 | LL | extern "C" fn f3_2(_: ...) {} | ^^^^^^ @@ -75,13 +75,13 @@ LL | unsafe extern "C" fn f3_2(_: ...) {} | ++++++ error: `...` must be the last argument of a C-variadic function - --> $DIR/variadic-ffi-semantic-restrictions.rs:30:20 + --> $DIR/variadic-ffi-semantic-restrictions.rs:29:20 | LL | extern "C" fn f3_3(_: ..., x: isize) {} | ^^^^^^ error[E0658]: c-variadic const function definitions are unstable - --> $DIR/variadic-ffi-semantic-restrictions.rs:33:1 + --> $DIR/variadic-ffi-semantic-restrictions.rs:32:1 | LL | const unsafe extern "C" fn f4_1(x: isize, _: ...) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -91,7 +91,7 @@ LL | const unsafe extern "C" fn f4_1(x: isize, _: ...) {} = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: c-variadic const function definitions are unstable - --> $DIR/variadic-ffi-semantic-restrictions.rs:37:1 + --> $DIR/variadic-ffi-semantic-restrictions.rs:36:1 | LL | const extern "C" fn f4_2(x: isize, _: ...) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -101,7 +101,7 @@ LL | const extern "C" fn f4_2(x: isize, _: ...) {} = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error: functions with a C variable argument list must be unsafe - --> $DIR/variadic-ffi-semantic-restrictions.rs:37:36 + --> $DIR/variadic-ffi-semantic-restrictions.rs:36:36 | LL | const extern "C" fn f4_2(x: isize, _: ...) {} | ^^^^^^ @@ -112,13 +112,13 @@ LL | const unsafe extern "C" fn f4_2(x: isize, _: ...) {} | ++++++ error: `...` must be the last argument of a C-variadic function - --> $DIR/variadic-ffi-semantic-restrictions.rs:42:26 + --> $DIR/variadic-ffi-semantic-restrictions.rs:41:26 | LL | const extern "C" fn f4_3(_: ..., x: isize, _: ...) {} | ^^^^^^ error[E0658]: c-variadic const function definitions are unstable - --> $DIR/variadic-ffi-semantic-restrictions.rs:42:1 + --> $DIR/variadic-ffi-semantic-restrictions.rs:41:1 | LL | const extern "C" fn f4_3(_: ..., x: isize, _: ...) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -128,7 +128,7 @@ LL | const extern "C" fn f4_3(_: ..., x: isize, _: ...) {} = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error: functions with a C variable argument list must be unsafe - --> $DIR/variadic-ffi-semantic-restrictions.rs:42:44 + --> $DIR/variadic-ffi-semantic-restrictions.rs:41:44 | LL | const extern "C" fn f4_3(_: ..., x: isize, _: ...) {} | ^^^^^^ @@ -139,13 +139,13 @@ LL | const unsafe extern "C" fn f4_3(_: ..., x: isize, _: ...) {} | ++++++ error: `...` must be the last argument of a C-variadic function - --> $DIR/variadic-ffi-semantic-restrictions.rs:48:13 + --> $DIR/variadic-ffi-semantic-restrictions.rs:47:13 | LL | fn e_f2(..., x: isize); | ^^^ error: `...` is not supported for non-extern functions - --> $DIR/variadic-ffi-semantic-restrictions.rs:55:23 + --> $DIR/variadic-ffi-semantic-restrictions.rs:54:23 | LL | fn i_f1(x: isize, _: ...) {} | ^^^^^^ @@ -153,7 +153,7 @@ LL | fn i_f1(x: isize, _: ...) {} = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list error: `...` is not supported for non-extern functions - --> $DIR/variadic-ffi-semantic-restrictions.rs:57:13 + --> $DIR/variadic-ffi-semantic-restrictions.rs:56:13 | LL | fn i_f2(_: ...) {} | ^^^^^^ @@ -161,13 +161,13 @@ LL | fn i_f2(_: ...) {} = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list error: `...` must be the last argument of a C-variadic function - --> $DIR/variadic-ffi-semantic-restrictions.rs:59:13 + --> $DIR/variadic-ffi-semantic-restrictions.rs:58:13 | LL | fn i_f3(_: ..., x: isize, _: ...) {} | ^^^^^^ error: `...` is not supported for non-extern functions - --> $DIR/variadic-ffi-semantic-restrictions.rs:59:31 + --> $DIR/variadic-ffi-semantic-restrictions.rs:58:31 | LL | fn i_f3(_: ..., x: isize, _: ...) {} | ^^^^^^ @@ -175,13 +175,13 @@ LL | fn i_f3(_: ..., x: isize, _: ...) {} = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list error: `...` must be the last argument of a C-variadic function - --> $DIR/variadic-ffi-semantic-restrictions.rs:62:13 + --> $DIR/variadic-ffi-semantic-restrictions.rs:61:13 | LL | fn i_f4(_: ..., x: isize, _: ...) {} | ^^^^^^ error: `...` is not supported for non-extern functions - --> $DIR/variadic-ffi-semantic-restrictions.rs:62:31 + --> $DIR/variadic-ffi-semantic-restrictions.rs:61:31 | LL | fn i_f4(_: ..., x: isize, _: ...) {} | ^^^^^^ @@ -189,7 +189,7 @@ LL | fn i_f4(_: ..., x: isize, _: ...) {} = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list error[E0658]: c-variadic const function definitions are unstable - --> $DIR/variadic-ffi-semantic-restrictions.rs:65:5 + --> $DIR/variadic-ffi-semantic-restrictions.rs:64:5 | LL | const fn i_f5(x: isize, _: ...) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -199,7 +199,7 @@ LL | const fn i_f5(x: isize, _: ...) {} = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error: `...` is not supported for non-extern functions - --> $DIR/variadic-ffi-semantic-restrictions.rs:65:29 + --> $DIR/variadic-ffi-semantic-restrictions.rs:64:29 | LL | const fn i_f5(x: isize, _: ...) {} | ^^^^^^ @@ -207,7 +207,7 @@ LL | const fn i_f5(x: isize, _: ...) {} = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list error: `...` is not supported for non-extern functions - --> $DIR/variadic-ffi-semantic-restrictions.rs:72:23 + --> $DIR/variadic-ffi-semantic-restrictions.rs:71:23 | LL | fn t_f1(x: isize, _: ...) {} | ^^^^^^ @@ -215,7 +215,7 @@ LL | fn t_f1(x: isize, _: ...) {} = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list error: `...` is not supported for non-extern functions - --> $DIR/variadic-ffi-semantic-restrictions.rs:74:23 + --> $DIR/variadic-ffi-semantic-restrictions.rs:73:23 | LL | fn t_f2(x: isize, _: ...); | ^^^^^^ @@ -223,7 +223,7 @@ LL | fn t_f2(x: isize, _: ...); = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list error: `...` is not supported for non-extern functions - --> $DIR/variadic-ffi-semantic-restrictions.rs:76:13 + --> $DIR/variadic-ffi-semantic-restrictions.rs:75:13 | LL | fn t_f3(_: ...) {} | ^^^^^^ @@ -231,7 +231,7 @@ LL | fn t_f3(_: ...) {} = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list error: `...` is not supported for non-extern functions - --> $DIR/variadic-ffi-semantic-restrictions.rs:78:13 + --> $DIR/variadic-ffi-semantic-restrictions.rs:77:13 | LL | fn t_f4(_: ...); | ^^^^^^ @@ -239,19 +239,19 @@ LL | fn t_f4(_: ...); = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list error: `...` must be the last argument of a C-variadic function - --> $DIR/variadic-ffi-semantic-restrictions.rs:80:13 + --> $DIR/variadic-ffi-semantic-restrictions.rs:79:13 | LL | fn t_f5(_: ..., x: isize) {} | ^^^^^^ error: `...` must be the last argument of a C-variadic function - --> $DIR/variadic-ffi-semantic-restrictions.rs:82:13 + --> $DIR/variadic-ffi-semantic-restrictions.rs:81:13 | LL | fn t_f6(_: ..., x: isize); | ^^^^^^ error[E0493]: destructor of `VaList<'_>` cannot be evaluated at compile-time - --> $DIR/variadic-ffi-semantic-restrictions.rs:33:43 + --> $DIR/variadic-ffi-semantic-restrictions.rs:32:43 | LL | const unsafe extern "C" fn f4_1(x: isize, _: ...) {} | ^ - value is dropped here @@ -263,7 +263,7 @@ LL | const unsafe extern "C" fn f4_1(x: isize, _: ...) {} = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0493]: destructor of `VaList<'_>` cannot be evaluated at compile-time - --> $DIR/variadic-ffi-semantic-restrictions.rs:37:36 + --> $DIR/variadic-ffi-semantic-restrictions.rs:36:36 | LL | const extern "C" fn f4_2(x: isize, _: ...) {} | ^ - value is dropped here @@ -275,7 +275,7 @@ LL | const extern "C" fn f4_2(x: isize, _: ...) {} = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0493]: destructor of `VaList<'_>` cannot be evaluated at compile-time - --> $DIR/variadic-ffi-semantic-restrictions.rs:65:29 + --> $DIR/variadic-ffi-semantic-restrictions.rs:64:29 | LL | const fn i_f5(x: isize, _: ...) {} | ^ - value is dropped here diff --git a/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-pretty.rs b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-pretty.rs index 358b50f7564bc..48b0a958fb3bb 100644 --- a/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-pretty.rs +++ b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-pretty.rs @@ -3,7 +3,8 @@ //@ check-pass -#![feature(c_variadic)] +#![feature(custom_inner_attributes)] // for top-level rustfmt::skip +#![rustfmt::skip] extern crate param_attrs; diff --git a/tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.rs b/tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.rs index d96bbee14ca19..b89440bf4271c 100644 --- a/tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.rs +++ b/tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.rs @@ -1,7 +1,8 @@ //@ edition:2015 //@ proc-macro: ident-mac.rs -#![feature(c_variadic)] +#![feature(custom_inner_attributes)] // for top-level rustfmt::skip +#![rustfmt::skip] #![allow(anonymous_parameters)] extern crate ident_mac; diff --git a/tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.stderr b/tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.stderr index ba3c0e347b186..74ceb290708f2 100644 --- a/tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.stderr +++ b/tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.stderr @@ -1,176 +1,176 @@ error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:12:23 + --> $DIR/proc-macro-cannot-be-used.rs:63:56 | -LL | extern "C" { fn ffi(#[id] arg1: i32, #[id] ...); } - | ^^ not a non-macro attribute +LL | fn issue_64682_associated_fn<'a>(#[id] arg1: u8, #[id] arg2: u8); + | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:12:40 + --> $DIR/proc-macro-cannot-be-used.rs:63:40 | -LL | extern "C" { fn ffi(#[id] arg1: i32, #[id] ...); } +LL | fn issue_64682_associated_fn<'a>(#[id] arg1: u8, #[id] arg2: u8); | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:16:40 + --> $DIR/proc-macro-cannot-be-used.rs:59:60 | -LL | unsafe extern "C" fn cvar(arg1: i32, #[id] mut args: ...) {} - | ^^ not a non-macro attribute +LL | fn trait4<'a>(#[id] self: Box, #[id] arg1: u8, #[id] Vec); + | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:19:30 + --> $DIR/proc-macro-cannot-be-used.rs:59:44 | -LL | type Alias = extern "C" fn(#[id] u8, #[id] ...); - | ^^ not a non-macro attribute +LL | fn trait4<'a>(#[id] self: Box, #[id] arg1: u8, #[id] Vec); + | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:19:40 + --> $DIR/proc-macro-cannot-be-used.rs:59:21 | -LL | type Alias = extern "C" fn(#[id] u8, #[id] ...); - | ^^ not a non-macro attribute +LL | fn trait4<'a>(#[id] self: Box, #[id] arg1: u8, #[id] Vec); + | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:23:11 + --> $DIR/proc-macro-cannot-be-used.rs:56:41 | -LL | fn free(#[id] arg1: u8) { - | ^^ not a non-macro attribute +LL | fn trait3<'a>(#[id] &'a mut self, #[id] arg1: u8); + | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:25:18 + --> $DIR/proc-macro-cannot-be-used.rs:56:21 | -LL | let lam = |#[id] W(x), #[id] y: usize| (); - | ^^ not a non-macro attribute +LL | fn trait3<'a>(#[id] &'a mut self, #[id] arg1: u8); + | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:25:30 + --> $DIR/proc-macro-cannot-be-used.rs:53:30 | -LL | let lam = |#[id] W(x), #[id] y: usize| (); +LL | fn trait2(#[id] &self, #[id] arg1: u8); | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:31:20 + --> $DIR/proc-macro-cannot-be-used.rs:53:17 | -LL | fn inherent1(#[id] self, #[id] arg1: u8) {} - | ^^ not a non-macro attribute +LL | fn trait2(#[id] &self, #[id] arg1: u8); + | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:31:32 + --> $DIR/proc-macro-cannot-be-used.rs:50:29 | -LL | fn inherent1(#[id] self, #[id] arg1: u8) {} - | ^^ not a non-macro attribute +LL | fn trait1(#[id] self, #[id] arg1: u8); + | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:34:20 + --> $DIR/proc-macro-cannot-be-used.rs:50:17 | -LL | fn inherent2(#[id] &self, #[id] arg1: u8) {} - | ^^ not a non-macro attribute +LL | fn trait1(#[id] self, #[id] arg1: u8); + | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:34:33 + --> $DIR/proc-macro-cannot-be-used.rs:44:56 | -LL | fn inherent2(#[id] &self, #[id] arg1: u8) {} - | ^^ not a non-macro attribute +LL | fn issue_64682_associated_fn<'a>(#[id] arg1: u8, #[id] arg2: u8) {} + | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:37:24 + --> $DIR/proc-macro-cannot-be-used.rs:44:40 | -LL | fn inherent3<'a>(#[id] &'a mut self, #[id] arg1: u8) {} - | ^^ not a non-macro attribute +LL | fn issue_64682_associated_fn<'a>(#[id] arg1: u8, #[id] arg2: u8) {} + | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:37:44 + --> $DIR/proc-macro-cannot-be-used.rs:41:47 | -LL | fn inherent3<'a>(#[id] &'a mut self, #[id] arg1: u8) {} - | ^^ not a non-macro attribute +LL | fn inherent4<'a>(#[id] self: Box, #[id] arg1: u8) {} + | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:40:24 + --> $DIR/proc-macro-cannot-be-used.rs:41:24 | LL | fn inherent4<'a>(#[id] self: Box, #[id] arg1: u8) {} | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:40:47 + --> $DIR/proc-macro-cannot-be-used.rs:38:44 | -LL | fn inherent4<'a>(#[id] self: Box, #[id] arg1: u8) {} - | ^^ not a non-macro attribute +LL | fn inherent3<'a>(#[id] &'a mut self, #[id] arg1: u8) {} + | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:43:40 + --> $DIR/proc-macro-cannot-be-used.rs:38:24 | -LL | fn issue_64682_associated_fn<'a>(#[id] arg1: u8, #[id] arg2: u8) {} - | ^^ not a non-macro attribute +LL | fn inherent3<'a>(#[id] &'a mut self, #[id] arg1: u8) {} + | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:43:56 + --> $DIR/proc-macro-cannot-be-used.rs:35:33 | -LL | fn issue_64682_associated_fn<'a>(#[id] arg1: u8, #[id] arg2: u8) {} - | ^^ not a non-macro attribute +LL | fn inherent2(#[id] &self, #[id] arg1: u8) {} + | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:49:17 + --> $DIR/proc-macro-cannot-be-used.rs:35:20 | -LL | fn trait1(#[id] self, #[id] arg1: u8); - | ^^ not a non-macro attribute +LL | fn inherent2(#[id] &self, #[id] arg1: u8) {} + | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:49:29 + --> $DIR/proc-macro-cannot-be-used.rs:32:32 | -LL | fn trait1(#[id] self, #[id] arg1: u8); - | ^^ not a non-macro attribute +LL | fn inherent1(#[id] self, #[id] arg1: u8) {} + | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:52:17 + --> $DIR/proc-macro-cannot-be-used.rs:32:20 | -LL | fn trait2(#[id] &self, #[id] arg1: u8); - | ^^ not a non-macro attribute +LL | fn inherent1(#[id] self, #[id] arg1: u8) {} + | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:52:30 + --> $DIR/proc-macro-cannot-be-used.rs:26:30 | -LL | fn trait2(#[id] &self, #[id] arg1: u8); +LL | let lam = |#[id] W(x), #[id] y: usize| (); | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:55:21 + --> $DIR/proc-macro-cannot-be-used.rs:26:18 | -LL | fn trait3<'a>(#[id] &'a mut self, #[id] arg1: u8); - | ^^ not a non-macro attribute +LL | let lam = |#[id] W(x), #[id] y: usize| (); + | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:55:41 + --> $DIR/proc-macro-cannot-be-used.rs:24:11 | -LL | fn trait3<'a>(#[id] &'a mut self, #[id] arg1: u8); - | ^^ not a non-macro attribute +LL | fn free(#[id] arg1: u8) { + | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:58:21 + --> $DIR/proc-macro-cannot-be-used.rs:20:40 | -LL | fn trait4<'a>(#[id] self: Box, #[id] arg1: u8, #[id] Vec); - | ^^ not a non-macro attribute +LL | type Alias = extern "C" fn(#[id] u8, #[id] ...); + | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:58:44 + --> $DIR/proc-macro-cannot-be-used.rs:20:30 | -LL | fn trait4<'a>(#[id] self: Box, #[id] arg1: u8, #[id] Vec); - | ^^ not a non-macro attribute +LL | type Alias = extern "C" fn(#[id] u8, #[id] ...); + | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:58:60 + --> $DIR/proc-macro-cannot-be-used.rs:17:40 | -LL | fn trait4<'a>(#[id] self: Box, #[id] arg1: u8, #[id] Vec); - | ^^ not a non-macro attribute +LL | unsafe extern "C" fn cvar(arg1: i32, #[id] mut args: ...) {} + | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:62:40 + --> $DIR/proc-macro-cannot-be-used.rs:13:40 | -LL | fn issue_64682_associated_fn<'a>(#[id] arg1: u8, #[id] arg2: u8); +LL | extern "C" { fn ffi(#[id] arg1: i32, #[id] ...); } | ^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `id` - --> $DIR/proc-macro-cannot-be-used.rs:62:56 + --> $DIR/proc-macro-cannot-be-used.rs:13:23 | -LL | fn issue_64682_associated_fn<'a>(#[id] arg1: u8, #[id] arg2: u8); - | ^^ not a non-macro attribute +LL | extern "C" { fn ffi(#[id] arg1: i32, #[id] ...); } + | ^^ not a non-macro attribute error: aborting due to 29 previous errors diff --git a/tests/ui/sanitizer/kcfi-c-variadic.rs b/tests/ui/sanitizer/kcfi-c-variadic.rs index 651029ab7dfe6..2f88ccfb1269c 100644 --- a/tests/ui/sanitizer/kcfi-c-variadic.rs +++ b/tests/ui/sanitizer/kcfi-c-variadic.rs @@ -4,8 +4,6 @@ //@ ignore-backends: gcc //@ run-pass -#![feature(c_variadic)] - trait Trait { unsafe extern "C" fn foo(x: i32, y: i32, mut ap: ...) -> i32 { x + y + ap.next_arg::() + ap.next_arg::() diff --git a/tests/ui/thir-print/c-variadic.rs b/tests/ui/thir-print/c-variadic.rs index a418e17e84c35..b07c422ea3cd4 100644 --- a/tests/ui/thir-print/c-variadic.rs +++ b/tests/ui/thir-print/c-variadic.rs @@ -1,6 +1,5 @@ //@ compile-flags: -Zunpretty=thir-tree --crate-type=lib //@ check-pass -#![feature(c_variadic)] #![expect(varargs_without_pattern)] // The `...` argument uses `PatKind::Missing`. diff --git a/tests/ui/thir-print/c-variadic.stderr b/tests/ui/thir-print/c-variadic.stderr index a4050695944d4..e05e50a93f57d 100644 --- a/tests/ui/thir-print/c-variadic.stderr +++ b/tests/ui/thir-print/c-variadic.stderr @@ -1,6 +1,6 @@ Future incompatibility report: Future breakage diagnostic: warning: missing pattern for `...` argument - --> $DIR/c-variadic.rs:7:34 + --> $DIR/c-variadic.rs:6:34 | LL | unsafe extern "C" fn foo(_: i32, ...) {} | ^^^ diff --git a/tests/ui/thir-print/c-variadic.stdout b/tests/ui/thir-print/c-variadic.stdout index a426902b2deb2..ad6dacb4753b3 100644 --- a/tests/ui/thir-print/c-variadic.stdout +++ b/tests/ui/thir-print/c-variadic.stdout @@ -2,13 +2,13 @@ DefId(0:3 ~ c_variadic[a5de]::foo): params: [ Param { ty: i32 - ty_span: Some($DIR/c-variadic.rs:7:29: 7:32 (#0)) + ty_span: Some($DIR/c-variadic.rs:6:29: 6:32 (#0)) self_kind: None hir_id: Some(HirId(DefId(0:3 ~ c_variadic[a5de]::foo).1)) param: Some( Pat { ty: i32 - span: $DIR/c-variadic.rs:7:26: 7:27 (#0) + span: $DIR/c-variadic.rs:6:26: 6:27 (#0) kind: PatKind { Wild } @@ -23,7 +23,7 @@ params: [ param: Some( Pat { ty: std::ffi::VaList<'{erased}> - span: $DIR/c-variadic.rs:7:34: 7:37 (#0) + span: $DIR/c-variadic.rs:6:34: 6:37 (#0) kind: PatKind { Missing } @@ -35,7 +35,7 @@ body: Expr { ty: () temp_scope_id: 6 - span: $DIR/c-variadic.rs:7:39: 7:41 (#0) + span: $DIR/c-variadic.rs:6:39: 6:41 (#0) kind: Scope { region_scope: Node(6) @@ -44,11 +44,11 @@ body: Expr { ty: () temp_scope_id: 6 - span: $DIR/c-variadic.rs:7:39: 7:41 (#0) + span: $DIR/c-variadic.rs:6:39: 6:41 (#0) kind: Block { targeted_by_break: false - span: $DIR/c-variadic.rs:7:39: 7:41 (#0) + span: $DIR/c-variadic.rs:6:39: 6:41 (#0) region_scope: Node(5) safety_mode: Safe stmts: []