diff --git a/compiler/rustc_ast_passes/src/ast_validation.rs b/compiler/rustc_ast_passes/src/ast_validation.rs index fe1da820cf74f..85b9c06679d5e 100644 --- a/compiler/rustc_ast_passes/src/ast_validation.rs +++ b/compiler/rustc_ast_passes/src/ast_validation.rs @@ -46,7 +46,7 @@ enum SelfSemantic { No, } -/// Is `#[splat]` allowed semantically in a function or closure? +/// Is `#[arg_splat]` allowed semantically in a function or closure? /// Only applies to the function kind and header, the parameters are checked elsewhere. enum SplatSemantic { Yes, @@ -439,7 +439,7 @@ impl<'a> AstValidator<'a> { /// Emits an error if a function declaration has more than one splatted argument, with a /// C-variadic parameter, or a splat at an unsupported index (for performance). - /// Example: `fn foo(#[splat] x: (), #[splat] y: ())` will emit an error. + /// Example: `fn foo(#[arg_splat] x: (), #[arg_splat] y: ())` will emit an error. fn check_decl_splatting( &self, fn_decl: &FnDecl, diff --git a/compiler/rustc_ast_passes/src/diagnostics.rs b/compiler/rustc_ast_passes/src/diagnostics.rs index 0cf7ef5c1de19..bd5528d91334c 100644 --- a/compiler/rustc_ast_passes/src/diagnostics.rs +++ b/compiler/rustc_ast_passes/src/diagnostics.rs @@ -125,46 +125,46 @@ pub(crate) struct FnParamCVarArgsNotLast { #[derive(Diagnostic)] #[diag( - "`#[splat]` is only supported on argument index {$max_valid_splatted_arg_index} or less, this `#[splat]` is on index {$first_invalid_splatted_arg_index}" + "`#[arg_splat]` is only supported on argument index {$max_valid_splatted_arg_index} or less, this `#[arg_splat]` is on index {$first_invalid_splatted_arg_index}" )] -#[help("remove `#[splat]`, or use it on an argument closer to the start of the argument list")] +#[help("remove `#[arg_splat]`, or use it on an argument closer to the start of the argument list")] pub(crate) struct InvalidSplattedArgs { pub max_valid_splatted_arg_index: u16, pub first_invalid_splatted_arg_index: u16, #[primary_span] - #[label("`#[splat]` is not supported here")] + #[label("`#[arg_splat]` is not supported here")] pub spans: Vec, } #[derive(Diagnostic)] -#[diag("multiple `#[splat]`s are not allowed in the same function argument list")] -#[help("remove `#[splat]` from all but one argument")] +#[diag("multiple `#[arg_splat]`s are not allowed in the same function argument list")] +#[help("remove `#[arg_splat]` from all but one argument")] pub(crate) struct DuplicateSplattedArgs { #[primary_span] pub spans: Vec, } #[derive(Diagnostic)] -#[diag("`...` and `#[splat]` are not allowed in the same function argument list")] -#[help("remove `#[splat]` or remove `...`")] +#[diag("`...` and `#[arg_splat]` are not allowed in the same function argument list")] +#[help("remove `#[arg_splat]` or remove `...`")] pub(crate) struct CVarArgsAndSplat { #[primary_span] pub spans: Vec, } #[derive(Diagnostic)] -#[diag("`#[splat]` is not allowed on closure arguments")] -#[help("remove `#[splat]` or turn the closure into a function")] +#[diag("`#[arg_splat]` is not allowed on closure arguments")] +#[help("remove `#[arg_splat]` or turn the closure into a function")] pub(crate) struct SplatNotAllowedOnClosures { #[primary_span] pub spans: Vec, } #[derive(Diagnostic)] -#[diag("`#[splat]` is not allowed in the arguments of functions with the `{$abi}` ABI")] -#[help("remove `#[splat]` or change the ABI")] +#[diag("`#[arg_splat]` is not allowed in the arguments of functions with the `{$abi}` ABI")] +#[help("remove `#[arg_splat]` or change the ABI")] pub(crate) struct SplatNotAllowedOnAbiCall { #[primary_span] pub spans: Vec, diff --git a/compiler/rustc_ast_passes/src/feature_gate.rs b/compiler/rustc_ast_passes/src/feature_gate.rs index bec96621fbfed..866003272186d 100644 --- a/compiler/rustc_ast_passes/src/feature_gate.rs +++ b/compiler/rustc_ast_passes/src/feature_gate.rs @@ -483,7 +483,7 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) { gate_all!(pin_ergonomics, "pinned reference syntax is experimental"); gate_all!(postfix_match, "postfix match is experimental"); gate_all!(return_type_notation, "return type notation is experimental"); - gate_all!(splat, "`fn(#[splat] (a, ...))` is incomplete", "call as func((a, ...)) instead"); + gate_all!(splat, "`fn(#[arg_splat] (a, ...))` is incomplete", "call as func((a, ...)) instead"); gate_all!(super_let, "`super let` is experimental"); gate_all!(try_blocks_heterogeneous, "`try bikeshed` expression is experimental"); gate_all!(unnamed_enum_variants, "unnamed enum variants are experimental"); diff --git a/compiler/rustc_attr_parsing/src/attributes/splat.rs b/compiler/rustc_attr_parsing/src/attributes/splat.rs index ab34021ad7cdf..a0debd4fd2c1e 100644 --- a/compiler/rustc_attr_parsing/src/attributes/splat.rs +++ b/compiler/rustc_attr_parsing/src/attributes/splat.rs @@ -1,4 +1,4 @@ -//! Attribute parsing for the `#[splat]` function argument overloading attribute. +//! Attribute parsing for the `#[arg_splat]` function argument overloading attribute. //! This attribute modifies typecheck to support overload resolution, then modifies codegen for performance. use rustc_feature::AttributeStability; @@ -11,6 +11,6 @@ impl NoArgsAttributeParser for SplatParser { const PATH: &[Symbol] = &[sym::splat]; const ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::AllowList(&[Allow(Target::Param)]); const STABILITY: AttributeStability = - unstable!(splat, "the `#[splat]` attribute is experimental"); + unstable!(splat, "the `#[arg_splat]` attribute is experimental"); const CREATE: fn(Span) -> AttributeKind = AttributeKind::Splat; } diff --git a/compiler/rustc_feature/src/builtin_attrs.rs b/compiler/rustc_feature/src/builtin_attrs.rs index c7e9a939f2ba1..622554c37474d 100644 --- a/compiler/rustc_feature/src/builtin_attrs.rs +++ b/compiler/rustc_feature/src/builtin_attrs.rs @@ -209,7 +209,7 @@ pub static BUILTIN_ATTRIBUTES: &[Symbol] = &[ // - https://github.com/rust-lang/rust/issues/130494 sym::pin_v2, - // The `#[splat]` attribute is part of the `splat` experiment + // The `#[arg_splat]` attribute is part of the `splat` experiment // that improves the ergonomics of function overloading, tracked in: // // - https://github.com/rust-lang/rust/issues/153629 diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs index 3649cf24ea822..3e2eb7d1e184a 100644 --- a/compiler/rustc_feature/src/unstable.rs +++ b/compiler/rustc_feature/src/unstable.rs @@ -734,7 +734,7 @@ declare_features! ( /// Allows specialization of implementations (RFC 1210). (incomplete, specialization, "1.7.0", Some(31844)), /// Experimental "splatting" of function call arguments at the call site. - /// e.g. `foo(a, b, c)` calls `#[splat] fn foo((a: A, b: B, c: C))`. + /// e.g. `foo(a, b, c)` calls `#[arg_splat] fn foo((a: A, b: B, c: C))`. (incomplete, splat, "1.98.0", Some(153629)), /// Allows using `#[rustc_align_static(...)]` on static items. (unstable, static_align, "1.91.0", Some(146177)), diff --git a/compiler/rustc_hir/src/attrs/data_structures.rs b/compiler/rustc_hir/src/attrs/data_structures.rs index bbec92786f047..5c928f970608c 100644 --- a/compiler/rustc_hir/src/attrs/data_structures.rs +++ b/compiler/rustc_hir/src/attrs/data_structures.rs @@ -1675,7 +1675,7 @@ pub enum AttributeKind { reason: Option, }, - /// Represents `#[splat]` + /// Represents `#[arg_splat]` Splat(Span), /// Represents `#[stable]`, `#[unstable]` and `#[rustc_allowed_through_unstable_modules]`. diff --git a/compiler/rustc_hir_analysis/src/check/mod.rs b/compiler/rustc_hir_analysis/src/check/mod.rs index a3bdd0bae7e77..27f88b632d954 100644 --- a/compiler/rustc_hir_analysis/src/check/mod.rs +++ b/compiler/rustc_hir_analysis/src/check/mod.rs @@ -451,7 +451,7 @@ fn fn_sig_suggestion<'tcx>( .iter() .enumerate() .map(|(i, ty)| { - let splat = if splatted_arg_index == Some(i) { "#[splat] " } else { "" }; + let splat = if splatted_arg_index == Some(i) { "#[arg_splat] " } else { "" }; let arg_ty = match ty.kind() { ty::Param(_) if assoc.is_method() && i == 0 => "self".to_string(), ty::Ref(reg, ref_ty, mutability) if i == 0 => { diff --git a/compiler/rustc_hir_pretty/src/lib.rs b/compiler/rustc_hir_pretty/src/lib.rs index 393e238712960..305158f0ecb28 100644 --- a/compiler/rustc_hir_pretty/src/lib.rs +++ b/compiler/rustc_hir_pretty/src/lib.rs @@ -2278,7 +2278,7 @@ impl<'a> State<'a> { let mut i = 0; let mut print_arg = |s: &mut Self, ty: Option<&hir::Ty<'_>>| { if Some(i) == decl.splatted().map(usize::from) { - s.word("#[splat]"); + s.word("#[arg_splat]"); } if i == 0 && decl.implicit_self().has_implicit_self() { s.print_implicit_self(&decl.implicit_self()); diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs index c76febd539ef8..11fabf6e86008 100644 --- a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs +++ b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs @@ -50,7 +50,7 @@ rustc_index::newtype_index! { pub(crate) struct GenericIdx {} } -/// Outcome of checking arguments that are tupled by "rust-call" or `#[splat]`. +/// Outcome of checking arguments that are tupled by "rust-call" or `#[arg_splat]`. #[derive(Debug, Clone, Eq, PartialEq)] struct TupledArgCheckOutcome<'tcx> { /// The error code to emit if the arguments are not compatible. @@ -559,7 +559,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { } } - /// Check arguments that are tupled by "rust-call" or `#[splat]`. + /// Check arguments that are tupled by "rust-call" or `#[arg_splat]`. fn check_tupled_arguments( &self, // Span enclosing the call site @@ -593,10 +593,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { // The argument difference can range from -1 to u16::MAX - 1, so we count the number // of tupled arguments instead. // (An empty argument list becomes a unit tuple in the callee.) - // 0: f() -> f(#[splat] _: ()) - // 1: f(a) -> f(#[splat] _: (A,)) - // 2: f(a, b) -> f(#[splat] _: (A, B)) - // The Fn* traits ensure this by construction, and `#[splat]` can only be applied to + // 0: f() -> f(#[arg_splat] _: ()) + // 1: f(a) -> f(#[arg_splat] _: (A,)) + // 2: f(a, b) -> f(#[arg_splat] _: (A, B)) + // The Fn* traits ensure this by construction, and `#[arg_splat]` can only be applied to // an actual argument. let tupled_args_count = (1 + provided_args.len()).checked_sub(formal_input_tys.len()); debug!( diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs index 3c7e3b63ee9b5..9faee9824a21a 100644 --- a/compiler/rustc_middle/src/ty/print/pretty.rs +++ b/compiler/rustc_middle/src/ty/print/pretty.rs @@ -1505,7 +1505,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write { let mut input_iter = inputs.iter().copied(); if let Some(index) = splatted_arg_index { self.comma_sep((&mut input_iter).take(usize::from(index)))?; - write!(self, ", #[splat]")?; + write!(self, ", #[arg_splat]")?; self.comma_sep(input_iter)?; } else { self.comma_sep(input_iter)?; diff --git a/compiler/rustc_mir_build/src/thir/cx/expr.rs b/compiler/rustc_mir_build/src/thir/cx/expr.rs index 10dc59a8950fd..635cbe9b8077e 100644 --- a/compiler/rustc_mir_build/src/thir/cx/expr.rs +++ b/compiler/rustc_mir_build/src/thir/cx/expr.rs @@ -375,7 +375,7 @@ impl<'tcx> ThirBuildCx<'tcx> { hir::ExprKind::MethodCall(segment, receiver, args, fn_span) => { if self.typeck_results.is_splatted_call(expr) { // The callee has a splatted tuple argument. - // rewrite `receiver.f(a, u, v)` into `receiver.f(a, #[splat] (u, v))` + // rewrite `receiver.f(a, u, v)` into `receiver.f(a, #[arg_splat] (u, v))` self.convert_splatted_callee(expr, fn_span, args, Some(receiver)) } else { // Rewrite a.b(c) into UFCS form like Trait::b(a, c) @@ -425,7 +425,7 @@ impl<'tcx> ThirBuildCx<'tcx> { } } else if self.typeck_results.is_splatted_call(expr) { // The callee has a splatted tuple argument. - // rewrite `f(a, u, v)` into `f(a, #[splat] (u, v))` + // rewrite `f(a, u, v)` into `f(a, #[arg_splat] (u, v))` self.convert_splatted_callee(expr, fun.span, args, None) } else { // Tuple-like ADTs are represented as ExprKind::Call. We convert them here. @@ -1288,7 +1288,7 @@ impl<'tcx> ThirBuildCx<'tcx> { } /// The callee has a splatted tuple argument. - /// Rewrite a splatted call `receiver.f(a, u, v)` into `receiver.f(a, #[splat] (u, v))`. + /// Rewrite a splatted call `receiver.f(a, u, v)` into `receiver.f(a, #[arg_splat] (u, v))`. /// The receiver is optional. fn convert_splatted_callee( &mut self, @@ -1304,7 +1304,7 @@ impl<'tcx> ThirBuildCx<'tcx> { let tupled_arg_index = usize::from(tupled_arg_index); let tupled_args_count = usize::from(tupled_args_count); - // Splatting an empty tuple is permitted: `a.f() -> Trait::f(a, #[splat] ())`. + // Splatting an empty tuple is permitted: `a.f() -> Trait::f(a, #[arg_splat] ())`. // In that case, the tupled arg index is one past the end of the args. if tupled_arg_index + tupled_args_count > args.len() { span_bug!( diff --git a/compiler/rustc_public/src/unstable/convert/internal.rs b/compiler/rustc_public/src/unstable/convert/internal.rs index 2f174eeee0059..46f06115d8eac 100644 --- a/compiler/rustc_public/src/unstable/convert/internal.rs +++ b/compiler/rustc_public/src/unstable/convert/internal.rs @@ -313,7 +313,7 @@ impl RustcInternal for FnSig { tables: &mut Tables<'_, BridgeTys>, tcx: impl InternalCx<'tcx>, ) -> Self::T<'tcx> { - // FIXME(splat): When `#[splat]` is complete (or stable), add splatted to the public FnSig + // FIXME(splat): When `#[arg_splat]` is complete (or stable), add splatted to the public FnSig let fn_sig_kind = rustc_ty::FnSigKind::default() .set_abi(self.abi.internal(tables, tcx)) .set_safety(self.safety.internal(tables, tcx)) diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 95421ba8cfdab..b513f2769cf3e 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -2010,7 +2010,7 @@ symbols! { specialization, speed, spirv, - splat, + splat: "arg_splat", splatted_index, spotlight, sqrtf16, diff --git a/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs b/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs index 69ef6c8d2a5c4..88e63b377ad82 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs @@ -829,11 +829,11 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { for (i, (l, r)) in iter::zip(sig1.inputs(), sig2.inputs()).enumerate() { self.push_comma(&mut values.0, &mut values.1, i); if Some(i) == splatted_arg_index1 { - values.0.push("#[splat]", splatted_arg_index1 != splatted_arg_index2); + values.0.push("#[arg_splat]", splatted_arg_index1 != splatted_arg_index2); values.0.push_normal(" "); } if Some(i) == splatted_arg_index2 { - values.1.push("#[splat]", splatted_arg_index1 != splatted_arg_index2); + values.1.push("#[arg_splat]", splatted_arg_index1 != splatted_arg_index2); values.1.push_normal(" "); } let (x1, x2) = self.cmp(*l, *r); diff --git a/compiler/rustc_type_ir/src/ty_kind.rs b/compiler/rustc_type_ir/src/ty_kind.rs index 25868bc9377e2..c6342c431a655 100644 --- a/compiler/rustc_type_ir/src/ty_kind.rs +++ b/compiler/rustc_type_ir/src/ty_kind.rs @@ -1241,7 +1241,7 @@ impl fmt::Debug for FnSig { write!(f, ", ")?; } if Some(i) == fn_sig_kind.splatted().map(usize::from) { - write!(f, "#[splat] ")?; + write!(f, "#[arg_splat] ")?; } write!(f, "{ty:?}")?; } diff --git a/library/core/src/mem/type_info.rs b/library/core/src/mem/type_info.rs index 7614adbcc532b..0183e7a48844f 100644 --- a/library/core/src/mem/type_info.rs +++ b/library/core/src/mem/type_info.rs @@ -348,7 +348,7 @@ pub struct FnPtr { pub is_splatted: bool, /// The index of the splatted function argument in `inputs`, only valid if `is_splatted` is true. - /// e.g. in `fn overload(a: u8, #[splat] b: (f32, usize))` the index is 1, and it can be called + /// e.g. in `fn overload(a: u8, #[arg_splat] b: (f32, usize))` the index is 1, and it can be called /// as `overload(a, 1.0, 2)`. pub splatted_index: u8, } diff --git a/library/coretests/tests/mem/fn_ptr.rs b/library/coretests/tests/mem/fn_ptr.rs index 6e7e170917f55..12e217594aa77 100644 --- a/library/coretests/tests/mem/fn_ptr.rs +++ b/library/coretests/tests/mem/fn_ptr.rs @@ -192,7 +192,7 @@ fn test_variadic() { #[test] fn test_splat() { #[rustfmt::skip] - let TypeKind::FnPtr(fn_ptr_ty) = &(const { Type::of::().kind }) else { + let TypeKind::FnPtr(fn_ptr_ty) = &(const { Type::of::().kind }) else { panic!(); }; let FnPtr { diff --git a/src/doc/rustc/src/symbol-mangling/v0.md b/src/doc/rustc/src/symbol-mangling/v0.md index 982e372943766..804a2e269e167 100644 --- a/src/doc/rustc/src/symbol-mangling/v0.md +++ b/src/doc/rustc/src/symbol-mangling/v0.md @@ -778,7 +778,7 @@ Remaining primitives are encoded as a crate production, e.g. `C4f128`. Note that a zero-length tuple (unit) is encoded with the `u` *[basic-type]*. -* `w` — A [splatted type][tracking-splat] `#[splat] T`. +* `w` — A [splatted type][tracking-splat] `#[arg_splat] T`. > splatted-type → `w` {*[type]*} diff --git a/src/tools/rustfmt/tests/source/reorder_modules/ABCD/mod.rs b/src/tools/rustfmt/tests/source/reorder_modules/ABCD/mod.rs deleted file mode 100644 index 8b137891791fe..0000000000000 --- a/src/tools/rustfmt/tests/source/reorder_modules/ABCD/mod.rs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/tools/rustfmt/tests/source/reorder_modules/ZYXW/mod.rs b/src/tools/rustfmt/tests/source/reorder_modules/ZYXW/mod.rs deleted file mode 100644 index 8b137891791fe..0000000000000 --- a/src/tools/rustfmt/tests/source/reorder_modules/ZYXW/mod.rs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/tools/rustfmt/tests/target/reorder_modules/ABCD/mod.rs b/src/tools/rustfmt/tests/target/reorder_modules/ABCD/mod.rs deleted file mode 100644 index 8b137891791fe..0000000000000 --- a/src/tools/rustfmt/tests/target/reorder_modules/ABCD/mod.rs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/tools/rustfmt/tests/target/reorder_modules/ZYXW/mod.rs b/src/tools/rustfmt/tests/target/reorder_modules/ZYXW/mod.rs deleted file mode 100644 index 8b137891791fe..0000000000000 --- a/src/tools/rustfmt/tests/target/reorder_modules/ZYXW/mod.rs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/tests/ui/README.md b/tests/ui/README.md index 8c159b0e0447f..76bc490f12b39 100644 --- a/tests/ui/README.md +++ b/tests/ui/README.md @@ -1297,7 +1297,7 @@ See [Tracking issue for specialization (RFC 1210) #31844](https://github.com/rus ## `tests/ui/splat` -Tests for the `#![feature(splat)]` attribute. +Tests for the `#![feature(arg_splat)]` attribute. See [Tracking Issue for argument splatting #153629](https://github.com/rust-lang/rust/issues/153629). diff --git a/tests/ui/feature-gates/feature-gate-splat.rs b/tests/ui/feature-gates/feature-gate-splat.rs index ebcfc0e5a1d9f..651ded8431a76 100644 --- a/tests/ui/feature-gates/feature-gate-splat.rs +++ b/tests/ui/feature-gates/feature-gate-splat.rs @@ -1,6 +1,6 @@ #[rustfmt::skip] fn tuple_args( - #[splat] //~ ERROR the `#[splat]` attribute is an experimental feature + #[arg_splat] //~ ERROR the `#[arg_splat]` attribute is an experimental feature (a, b, c): (u32, i8, char), ) { } diff --git a/tests/ui/feature-gates/feature-gate-splat.stderr b/tests/ui/feature-gates/feature-gate-splat.stderr index 11ddc2a3b82e7..ff7d59fcafcba 100644 --- a/tests/ui/feature-gates/feature-gate-splat.stderr +++ b/tests/ui/feature-gates/feature-gate-splat.stderr @@ -1,13 +1,13 @@ -error[E0658]: the `#[splat]` attribute is an experimental feature +error[E0658]: the `#[arg_splat]` attribute is an experimental feature --> $DIR/feature-gate-splat.rs:3:5 | -LL | #[splat] - | ^^^^^^^^ +LL | #[arg_splat] + | ^^^^^^^^^^^^ | = note: see issue #153629 for more information - = help: add `#![feature(splat)]` to the crate attributes to enable + = help: add `#![feature(arg_splat)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - = note: the `#[splat]` attribute is experimental + = note: the `#[arg_splat]` attribute is experimental error: aborting due to 1 previous error diff --git a/tests/ui/splat/arg-count-ice-issue-158482.rs b/tests/ui/splat/arg-count-ice-issue-158482.rs index 27f036b8a5906..f5ccd97d4fc46 100644 --- a/tests/ui/splat/arg-count-ice-issue-158482.rs +++ b/tests/ui/splat/arg-count-ice-issue-158482.rs @@ -1,12 +1,12 @@ //! Checks that an incorrect number of arguments to splat doesn't panic. -#![feature(splat)] +#![feature(arg_splat)] struct Foo {} trait BarTrait { - fn trait_assoc(w: W, #[splat] _s: (u32, u8)); + fn trait_assoc(w: W, #[arg_splat] _s: (u32, u8)); } impl BarTrait for Foo { - fn trait_assoc(_w: W, #[splat] _s: (u32, u8)) {} + fn trait_assoc(_w: W, #[arg_splat] _s: (u32, u8)) {} } fn main() { Foo::trait_assoc() diff --git a/tests/ui/splat/reject-closure-issue-158605.rs b/tests/ui/splat/reject-closure-issue-158605.rs index 7464bab2a77d2..4416a661556fb 100644 --- a/tests/ui/splat/reject-closure-issue-158605.rs +++ b/tests/ui/splat/reject-closure-issue-158605.rs @@ -1,26 +1,26 @@ //! Checks that closures and rust-call functions can't be splatted. //! This should be rejected until we decide on sensible semantics. -#![feature(splat, unboxed_closures, tuple_trait)] +#![feature(arg_splat, unboxed_closures, tuple_trait)] #![expect(incomplete_features)] use std::marker::Tuple; trait Trait: Tuple + Sized { - extern "rust-call" fn method(#[splat] self: Self); - //~^ ERROR: `#[splat]` is not allowed in the arguments of functions with the `rust-call` ABI + extern "rust-call" fn method(#[arg_splat] self: Self); + //~^ ERROR: `#[arg_splat]` is not allowed in the arguments of functions with the `rust-call` ABI } impl Trait for (i32, i64) { - extern "rust-call" fn method(#[splat] self: Self) { - //~^ ERROR: `#[splat]` is not allowed in the arguments of functions with the `rust-call` ABI + extern "rust-call" fn method(#[arg_splat] self: Self) { + //~^ ERROR: `#[arg_splat]` is not allowed in the arguments of functions with the `rust-call` ABI println!("{self:?}"); } } fn main() { - (|#[splat] x: i32| { - //~^ ERROR `#[splat]` is not allowed on closure arguments + (|#[arg_splat] x: i32| { + //~^ ERROR `#[arg_splat]` is not allowed on closure arguments println!("{x}"); })(1); diff --git a/tests/ui/splat/reject-closure-issue-158605.stderr b/tests/ui/splat/reject-closure-issue-158605.stderr index c23211459a0db..ece3f3d219334 100644 --- a/tests/ui/splat/reject-closure-issue-158605.stderr +++ b/tests/ui/splat/reject-closure-issue-158605.stderr @@ -1,30 +1,30 @@ -error: `#[splat]` is not allowed in the arguments of functions with the `rust-call` ABI +error: `#[arg_splat]` is not allowed in the arguments of functions with the `rust-call` ABI --> $DIR/reject-closure-issue-158605.rs:10:5 | -LL | extern "rust-call" fn method(#[splat] self: Self); - | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^ +LL | extern "rust-call" fn method(#[arg_splat] self: Self); + | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ | - = help: remove `#[splat]` or change the ABI + = help: remove `#[arg_splat]` or change the ABI -error: `#[splat]` is not allowed in the arguments of functions with the `rust-call` ABI +error: `#[arg_splat]` is not allowed in the arguments of functions with the `rust-call` ABI --> $DIR/reject-closure-issue-158605.rs:15:5 | -LL | extern "rust-call" fn method(#[splat] self: Self) { - | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^ +LL | extern "rust-call" fn method(#[arg_splat] self: Self) { + | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ | - = help: remove `#[splat]` or change the ABI + = help: remove `#[arg_splat]` or change the ABI -error: `#[splat]` is not allowed on closure arguments +error: `#[arg_splat]` is not allowed on closure arguments --> $DIR/reject-closure-issue-158605.rs:22:7 | -LL | (|#[splat] x: i32| { - | _______^^^^^^^^_________^ +LL | (|#[arg_splat] x: i32| { + | _______^^^^^^^^^^^^_________^ LL | | LL | | println!("{x}"); LL | | })(1); | |_____^ | - = help: remove `#[splat]` or turn the closure into a function + = help: remove `#[arg_splat]` or turn the closure into a function error: functions with the "rust-call" ABI must take a single non-self tuple argument --> $DIR/reject-closure-issue-158605.rs:28:26 diff --git a/tests/ui/splat/run-splat.rs b/tests/ui/splat/run-splat.rs index 06360883d5a43..3cf79e99e8696 100644 --- a/tests/ui/splat/run-splat.rs +++ b/tests/ui/splat/run-splat.rs @@ -1,7 +1,7 @@ //! Check that splat codegen works for simple cases. //@ run-pass //@ check-run-results -#![feature(splat, tuple_trait)] +#![feature(arg_splat, tuple_trait)] #![expect(incomplete_features)] use std::marker::Tuple; @@ -13,7 +13,7 @@ trait MethodArgs: Tuple { } impl Foo { - fn method(&self, #[splat] args: impl MethodArgs) { + fn method(&self, #[arg_splat] args: impl MethodArgs) { args.call_method(self) } } diff --git a/tests/ui/splat/splat-255-limit-fail.rs b/tests/ui/splat/splat-255-limit-fail.rs index 1e582ae6d9cf2..fe8fd329d67c6 100644 --- a/tests/ui/splat/splat-255-limit-fail.rs +++ b/tests/ui/splat/splat-255-limit-fail.rs @@ -1,9 +1,9 @@ // ignore-tidy-file-linelength -//! Test `#[splat]` fails over the 255th argument index (or higher). +//! Test `#[arg_splat]` fails over the 255th argument index (or higher). //! FIXME(splat): The 255 argument limit is a temporary performance hack. #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] #![expect(dead_code)] type A = (); @@ -47,7 +47,7 @@ fn s_255_terminal( _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, - #[splat] (_a, _b): (u32, i8), //~ ERROR `#[splat]` is only supported on argument index 254 or less, this `#[splat]` is on index 255 + #[arg_splat] (_a, _b): (u32, i8), //~ ERROR `#[arg_splat]` is only supported on argument index 254 or less, this `#[arg_splat]` is on index 255 ) {} #[rustfmt::skip] @@ -68,7 +68,7 @@ fn s_256_terminal( _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, - #[splat] (_a, _b): (u32, i8), //~ ERROR `#[splat]` is only supported on argument index 254 or less, this `#[splat]` is on index 256 + #[arg_splat] (_a, _b): (u32, i8), //~ ERROR `#[arg_splat]` is only supported on argument index 254 or less, this `#[arg_splat]` is on index 256 ) {} #[rustfmt::skip] @@ -88,7 +88,7 @@ fn s_255_non_terminal( _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, - #[splat] (_a, _b): (u32, i8), //~ ERROR `#[splat]` is only supported on argument index 254 or less, this `#[splat]` is on index 255 + #[arg_splat] (_a, _b): (u32, i8), //~ ERROR `#[arg_splat]` is only supported on argument index 254 or less, this `#[arg_splat]` is on index 255 _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, ) {} @@ -110,12 +110,12 @@ fn s_256_non_terminal( _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, - #[splat] (_a, _b): (u32, i8), //~ ERROR `#[splat]` is only supported on argument index 254 or less, this `#[splat]` is on index 256 + #[arg_splat] (_a, _b): (u32, i8), //~ ERROR `#[arg_splat]` is only supported on argument index 254 or less, this `#[arg_splat]` is on index 256 _: A, ) {} // It's only the splatted index that's constrained to 255, not the argument count of the caller or callee. -fn more_than_255_splatted_args(#[splat] _t: Tuple256) {} +fn more_than_255_splatted_args(#[arg_splat] _t: Tuple256) {} fn main() { let a = (); diff --git a/tests/ui/splat/splat-255-limit-fail.stderr b/tests/ui/splat/splat-255-limit-fail.stderr index a3a0b9cf3d350..3d7afa5151b6d 100644 --- a/tests/ui/splat/splat-255-limit-fail.stderr +++ b/tests/ui/splat/splat-255-limit-fail.stderr @@ -1,34 +1,34 @@ -error: `#[splat]` is only supported on argument index 254 or less, this `#[splat]` is on index 255 +error: `#[arg_splat]` is only supported on argument index 254 or less, this `#[arg_splat]` is on index 255 --> $DIR/splat-255-limit-fail.rs:50:5 | -LL | #[splat] (_a, _b): (u32, i8), - | ^^^^^^^^ `#[splat]` is not supported here +LL | #[arg_splat] (_a, _b): (u32, i8), + | ^^^^^^^^^^^^ `#[arg_splat]` is not supported here | - = help: remove `#[splat]`, or use it on an argument closer to the start of the argument list + = help: remove `#[arg_splat]`, or use it on an argument closer to the start of the argument list -error: `#[splat]` is only supported on argument index 254 or less, this `#[splat]` is on index 256 +error: `#[arg_splat]` is only supported on argument index 254 or less, this `#[arg_splat]` is on index 256 --> $DIR/splat-255-limit-fail.rs:71:5 | -LL | #[splat] (_a, _b): (u32, i8), - | ^^^^^^^^ `#[splat]` is not supported here +LL | #[arg_splat] (_a, _b): (u32, i8), + | ^^^^^^^^^^^^ `#[arg_splat]` is not supported here | - = help: remove `#[splat]`, or use it on an argument closer to the start of the argument list + = help: remove `#[arg_splat]`, or use it on an argument closer to the start of the argument list -error: `#[splat]` is only supported on argument index 254 or less, this `#[splat]` is on index 255 +error: `#[arg_splat]` is only supported on argument index 254 or less, this `#[arg_splat]` is on index 255 --> $DIR/splat-255-limit-fail.rs:91:5 | -LL | #[splat] (_a, _b): (u32, i8), - | ^^^^^^^^ `#[splat]` is not supported here +LL | #[arg_splat] (_a, _b): (u32, i8), + | ^^^^^^^^^^^^ `#[arg_splat]` is not supported here | - = help: remove `#[splat]`, or use it on an argument closer to the start of the argument list + = help: remove `#[arg_splat]`, or use it on an argument closer to the start of the argument list -error: `#[splat]` is only supported on argument index 254 or less, this `#[splat]` is on index 256 +error: `#[arg_splat]` is only supported on argument index 254 or less, this `#[arg_splat]` is on index 256 --> $DIR/splat-255-limit-fail.rs:113:5 | -LL | #[splat] (_a, _b): (u32, i8), - | ^^^^^^^^ `#[splat]` is not supported here +LL | #[arg_splat] (_a, _b): (u32, i8), + | ^^^^^^^^^^^^ `#[arg_splat]` is not supported here | - = help: remove `#[splat]`, or use it on an argument closer to the start of the argument list + = help: remove `#[arg_splat]`, or use it on an argument closer to the start of the argument list error[E0057]: this splatted function takes 256 arguments, but 255 were provided --> $DIR/splat-255-limit-fail.rs:124:5 diff --git a/tests/ui/splat/splat-255-limit-pass.rs b/tests/ui/splat/splat-255-limit-pass.rs index 2c892669225f6..78ee1c272329a 100644 --- a/tests/ui/splat/splat-255-limit-pass.rs +++ b/tests/ui/splat/splat-255-limit-pass.rs @@ -1,10 +1,10 @@ //@ run-pass // ignore-tidy-file-linelength -//! Test `#[splat]` on the 255th argument index (or lower). +//! Test `#[arg_splat]` on the 255th argument index (or lower). //! FIXME(splat): The 255 argument limit is a temporary performance hack. #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] #![expect(dead_code)] type A = (); @@ -48,7 +48,7 @@ fn s_253_terminal( _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, - #[splat] (_a, _b): (u32, i8), + #[arg_splat] (_a, _b): (u32, i8), ) {} #[rustfmt::skip] @@ -68,7 +68,7 @@ fn s_254_terminal( _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, - #[splat] (_a, _b): (u32, i8), + #[arg_splat] (_a, _b): (u32, i8), ) {} #[rustfmt::skip] @@ -88,13 +88,13 @@ fn s_254_non_terminal_272_args( _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, - #[splat] (_a, _b): (u32, i8), + #[arg_splat] (_a, _b): (u32, i8), _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, ) {} #[rustfmt::skip] fn s_0_initial_253_args( - #[splat] (_a, _b): (u32, i8), + #[arg_splat] (_a, _b): (u32, i8), _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, @@ -114,7 +114,7 @@ fn s_0_initial_253_args( #[rustfmt::skip] fn s_0_initial_254_args( - #[splat] (_a, _b): (u32, i8), + #[arg_splat] (_a, _b): (u32, i8), _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, @@ -134,7 +134,7 @@ fn s_0_initial_254_args( #[rustfmt::skip] fn s_0_initial_255_args( - #[splat] (_a, _b): (u32, i8), + #[arg_splat] (_a, _b): (u32, i8), _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, @@ -155,7 +155,7 @@ fn s_0_initial_255_args( // It's only the splatted index that's constrained to 255, not the argument count of the caller or callee. #[rustfmt::skip] fn s_0_initial_256_args( - #[splat] (_a, _b): (u32, i8), + #[arg_splat] (_a, _b): (u32, i8), _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, _: A, @@ -174,7 +174,7 @@ fn s_0_initial_256_args( _: A, ) {} -fn more_than_255_splatted_args(#[splat] _t: Tuple256) {} +fn more_than_255_splatted_args(#[arg_splat] _t: Tuple256) {} fn main() { let a = (); diff --git a/tests/ui/splat/splat-assoc-fn-tuple-simple.rs b/tests/ui/splat/splat-assoc-fn-tuple-simple.rs index d2681c0d2574c..3175e5db1f7b8 100644 --- a/tests/ui/splat/splat-assoc-fn-tuple-simple.rs +++ b/tests/ui/splat/splat-assoc-fn-tuple-simple.rs @@ -1,15 +1,15 @@ //@ run-pass -//! Test using `#[splat]` on associated function tuple arguments (no receivers). +//! Test using `#[arg_splat]` on associated function tuple arguments (no receivers). #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] struct Foo; impl Foo { - fn tuple_1(#[splat] (_a,): (u32,)) {} + fn tuple_1(#[arg_splat] (_a,): (u32,)) {} - fn tuple_3(#[splat] (_a, _b, _c): (u32, i32, i8)) {} + fn tuple_3(#[arg_splat] (_a, _b, _c): (u32, i32, i8)) {} } fn main() { diff --git a/tests/ui/splat/splat-async-fn-tuple-fail.rs b/tests/ui/splat/splat-async-fn-tuple-fail.rs index 308a6c4a2131e..e6228af32511a 100644 --- a/tests/ui/splat/splat-async-fn-tuple-fail.rs +++ b/tests/ui/splat/splat-async-fn-tuple-fail.rs @@ -1,14 +1,14 @@ //@ edition:2024 -//! Test that using `#[splat]` incorrectly on async functions gives errors. +//! Test that using `#[arg_splat]` incorrectly on async functions gives errors. #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] -async fn async_wrong_type(#[splat] _x: u32) {} +async fn async_wrong_type(#[arg_splat] _x: u32) {} //~^ ERROR cannot use splat attribute; the splatted argument type must be a tuple or unit, not a u32 -async fn async_multi_splat(#[splat] (_a, _b): (u32, i8), #[splat] (_c, _d): (u32, i8)) {} -//~^ ERROR multiple `#[splat]`s are not allowed in the same function argument list +async fn async_multi_splat(#[arg_splat] (_a, _b): (u32, i8), #[arg_splat] (_c, _d): (u32, i8)) {} +//~^ ERROR multiple `#[arg_splat]`s are not allowed in the same function argument list fn main() { async_wrong_type(1u32); diff --git a/tests/ui/splat/splat-async-fn-tuple-fail.stderr b/tests/ui/splat/splat-async-fn-tuple-fail.stderr index 7c73382d73a5a..3140b78824325 100644 --- a/tests/ui/splat/splat-async-fn-tuple-fail.stderr +++ b/tests/ui/splat/splat-async-fn-tuple-fail.stderr @@ -1,16 +1,16 @@ -error: multiple `#[splat]`s are not allowed in the same function argument list +error: multiple `#[arg_splat]`s are not allowed in the same function argument list --> $DIR/splat-async-fn-tuple-fail.rs:10:28 | -LL | async fn async_multi_splat(#[splat] (_a, _b): (u32, i8), #[splat] (_c, _d): (u32, i8)) {} - | ^^^^^^^^ ^^^^^^^^ +LL | async fn async_multi_splat(#[arg_splat] (_a, _b): (u32, i8), #[arg_splat] (_c, _d): (u32, i8)) {} + | ^^^^^^^^^^^^ ^^^^^^^^^^^^ | - = help: remove `#[splat]` from all but one argument + = help: remove `#[arg_splat]` from all but one argument error[E0277]: cannot use splat attribute; the splatted argument type must be a tuple or unit, not a u32 (u32) - --> $DIR/splat-async-fn-tuple-fail.rs:7:40 + --> $DIR/splat-async-fn-tuple-fail.rs:7:44 | -LL | async fn async_wrong_type(#[splat] _x: u32) {} - | ^^^ +LL | async fn async_wrong_type(#[arg_splat] _x: u32) {} + | ^^^ ... LL | async_wrong_type(1u32); | ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/splat/splat-async-fn-tuple.rs b/tests/ui/splat/splat-async-fn-tuple.rs index 81e56193bd4ab..dee1ff9531a85 100644 --- a/tests/ui/splat/splat-async-fn-tuple.rs +++ b/tests/ui/splat/splat-async-fn-tuple.rs @@ -1,13 +1,13 @@ //@ run-pass //@ edition:2024 -//! Test using `#[splat]` on tuple arguments of async functions. +//! Test using `#[arg_splat]` on tuple arguments of async functions. #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] -async fn async_tuple_args(#[splat] (_a, _b): (u32, i8)) {} +async fn async_tuple_args(#[arg_splat] (_a, _b): (u32, i8)) {} -async fn async_splat_non_terminal_arg(#[splat] (_a, _b): (u32, i8), _c: f64) {} +async fn async_splat_non_terminal_arg(#[arg_splat] (_a, _b): (u32, i8), _c: f64) {} fn main() { let _ = async_tuple_args(1u32, 2i8); diff --git a/tests/ui/splat/splat-cannot-resolve.rs b/tests/ui/splat/splat-cannot-resolve.rs index 1c22a53f82916..a6f81d41cd8f7 100644 --- a/tests/ui/splat/splat-cannot-resolve.rs +++ b/tests/ui/splat/splat-cannot-resolve.rs @@ -1,16 +1,16 @@ -//! Test that using `#[splat]` on un-resolvable types is an error. +//! Test that using `#[arg_splat]` on un-resolvable types is an error. #![allow(incomplete_features)] #![allow(unconditional_recursion)] -#![feature(splat)] +#![feature(arg_splat)] #![feature(tuple_trait)] -fn tuple(#[splat] t: impl Sized) -> impl Sized { +fn tuple(#[arg_splat] t: impl Sized) -> impl Sized { //~^ ERROR cannot resolve opaque type tuple(tuple((t, ()))) } -fn tuple_trait(#[splat] t: impl std::marker::Tuple) -> impl std::marker::Tuple { +fn tuple_trait(#[arg_splat] t: impl std::marker::Tuple) -> impl std::marker::Tuple { //~^ ERROR cannot resolve opaque type tuple_trait(tuple_trait((t, ()))) } @@ -20,12 +20,12 @@ trait Trait { type Tup: std::marker::Tuple; } -fn ambig(#[splat] t: Trait::MaybeTup) {} +fn ambig(#[arg_splat] t: Trait::MaybeTup) {} //~^ ERROR ambiguous associated type //~| ERROR cannot use splat attribute; the splatted argument type must be a tuple or unit, not a //~| ERROR cannot use splat attribute; the splatted argument type must be a tuple or unit, not a //~| ERROR cannot use splat attribute; the splatted argument type must be a tuple or unit, not a -fn ambig_tup(#[splat] t: Trait::Tup) {} +fn ambig_tup(#[arg_splat] t: Trait::Tup) {} //~^ ERROR ambiguous associated type //~| ERROR cannot use splat attribute; the splatted argument type must be a tuple or unit, not a //~| ERROR cannot use splat attribute; the splatted argument type must be a tuple or unit, not a diff --git a/tests/ui/splat/splat-cannot-resolve.stderr b/tests/ui/splat/splat-cannot-resolve.stderr index f91267d37dbc8..0f119be7c4ca7 100644 --- a/tests/ui/splat/splat-cannot-resolve.stderr +++ b/tests/ui/splat/splat-cannot-resolve.stderr @@ -1,89 +1,89 @@ error[E0223]: ambiguous associated type - --> $DIR/splat-cannot-resolve.rs:23:22 + --> $DIR/splat-cannot-resolve.rs:23:26 | -LL | fn ambig(#[splat] t: Trait::MaybeTup) {} - | ^^^^^^^^^^^^^^^ +LL | fn ambig(#[arg_splat] t: Trait::MaybeTup) {} + | ^^^^^^^^^^^^^^^ | help: if there were a type named `Example` that implemented `Trait`, you could use the fully-qualified path | -LL - fn ambig(#[splat] t: Trait::MaybeTup) {} -LL + fn ambig(#[splat] t: ::MaybeTup) {} +LL - fn ambig(#[arg_splat] t: Trait::MaybeTup) {} +LL + fn ambig(#[arg_splat] t: ::MaybeTup) {} | error[E0223]: ambiguous associated type - --> $DIR/splat-cannot-resolve.rs:28:26 + --> $DIR/splat-cannot-resolve.rs:28:30 | -LL | fn ambig_tup(#[splat] t: Trait::Tup) {} - | ^^^^^^^^^^ +LL | fn ambig_tup(#[arg_splat] t: Trait::Tup) {} + | ^^^^^^^^^^ | help: if there were a type named `Example` that implemented `Trait`, you could use the fully-qualified path | -LL - fn ambig_tup(#[splat] t: Trait::Tup) {} -LL + fn ambig_tup(#[splat] t: ::Tup) {} +LL - fn ambig_tup(#[arg_splat] t: Trait::Tup) {} +LL + fn ambig_tup(#[arg_splat] t: ::Tup) {} | error[E0720]: cannot resolve opaque type - --> $DIR/splat-cannot-resolve.rs:8:37 + --> $DIR/splat-cannot-resolve.rs:8:41 | -LL | fn tuple(#[splat] t: impl Sized) -> impl Sized { - | ^^^^^^^^^^ +LL | fn tuple(#[arg_splat] t: impl Sized) -> impl Sized { + | ^^^^^^^^^^ error[E0720]: cannot resolve opaque type - --> $DIR/splat-cannot-resolve.rs:13:56 + --> $DIR/splat-cannot-resolve.rs:13:60 | -LL | fn tuple_trait(#[splat] t: impl std::marker::Tuple) -> impl std::marker::Tuple { - | ^^^^^^^^^^^^^^^^^^^^^^^ +LL | fn tuple_trait(#[arg_splat] t: impl std::marker::Tuple) -> impl std::marker::Tuple { + | ^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: cannot use splat attribute; the splatted argument type must be a tuple or unit, not a {type error} ({type error}) - --> $DIR/splat-cannot-resolve.rs:23:22 + --> $DIR/splat-cannot-resolve.rs:23:26 | -LL | fn ambig(#[splat] t: Trait::MaybeTup) {} - | ^^^^^^^^^^^^^^^ +LL | fn ambig(#[arg_splat] t: Trait::MaybeTup) {} + | ^^^^^^^^^^^^^^^ ... LL | ambig(); | ^^^^^^^ error[E0277]: cannot use splat attribute; the splatted argument type must be a tuple or unit, not a {type error} ({type error}) - --> $DIR/splat-cannot-resolve.rs:28:26 + --> $DIR/splat-cannot-resolve.rs:28:30 | -LL | fn ambig_tup(#[splat] t: Trait::Tup) {} - | ^^^^^^^^^^ +LL | fn ambig_tup(#[arg_splat] t: Trait::Tup) {} + | ^^^^^^^^^^ ... LL | ambig_tup(); | ^^^^^^^^^^^ error[E0277]: cannot use splat attribute; the splatted argument type must be a tuple or unit, not a {type error} ({type error}) - --> $DIR/splat-cannot-resolve.rs:23:22 + --> $DIR/splat-cannot-resolve.rs:23:26 | -LL | fn ambig(#[splat] t: Trait::MaybeTup) {} - | ^^^^^^^^^^^^^^^ +LL | fn ambig(#[arg_splat] t: Trait::MaybeTup) {} + | ^^^^^^^^^^^^^^^ ... LL | ambig(1); | ^^^^^^^^ error[E0277]: cannot use splat attribute; the splatted argument type must be a tuple or unit, not a {type error} ({type error}) - --> $DIR/splat-cannot-resolve.rs:28:26 + --> $DIR/splat-cannot-resolve.rs:28:30 | -LL | fn ambig_tup(#[splat] t: Trait::Tup) {} - | ^^^^^^^^^^ +LL | fn ambig_tup(#[arg_splat] t: Trait::Tup) {} + | ^^^^^^^^^^ ... LL | ambig_tup(1); | ^^^^^^^^^^^^ error[E0277]: cannot use splat attribute; the splatted argument type must be a tuple or unit, not a {type error} ({type error}) - --> $DIR/splat-cannot-resolve.rs:23:22 + --> $DIR/splat-cannot-resolve.rs:23:26 | -LL | fn ambig(#[splat] t: Trait::MaybeTup) {} - | ^^^^^^^^^^^^^^^ +LL | fn ambig(#[arg_splat] t: Trait::MaybeTup) {} + | ^^^^^^^^^^^^^^^ ... LL | ambig(1, 2.0); | ^^^^^^^^^^^^^ error[E0277]: cannot use splat attribute; the splatted argument type must be a tuple or unit, not a {type error} ({type error}) - --> $DIR/splat-cannot-resolve.rs:28:26 + --> $DIR/splat-cannot-resolve.rs:28:30 | -LL | fn ambig_tup(#[splat] t: Trait::Tup) {} - | ^^^^^^^^^^ +LL | fn ambig_tup(#[arg_splat] t: Trait::Tup) {} + | ^^^^^^^^^^ ... LL | ambig_tup(1, 2.0); | ^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/splat/splat-const-fn-tuple-generic.rs b/tests/ui/splat/splat-const-fn-tuple-generic.rs index 646bf7e9b9f19..a16b6069ff659 100644 --- a/tests/ui/splat/splat-const-fn-tuple-generic.rs +++ b/tests/ui/splat/splat-const-fn-tuple-generic.rs @@ -1,20 +1,20 @@ //@ run-pass -//! Test using `#[splat]` on tuple arguments of const functions with generics. +//! Test using `#[arg_splat]` on tuple arguments of const functions with generics. #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] // Generic type in first position -const fn const_generic_first(#[splat] _: (T, u32)) {} +const fn const_generic_first(#[arg_splat] _: (T, u32)) {} // Generic type in second position -const fn const_generic_second(#[splat] _: (u32, T)) {} +const fn const_generic_second(#[arg_splat] _: (u32, T)) {} // Multiple generic types -const fn const_generic_both(#[splat] _: (T, U)) {} +const fn const_generic_both(#[arg_splat] _: (T, U)) {} // Generic with extra non-splatted arg -const fn const_generic_extra(#[splat] _: (T, u32), _extra: i32) {} +const fn const_generic_extra(#[arg_splat] _: (T, u32), _extra: i32) {} fn main() { const_generic_first(1i8, 2u32); diff --git a/tests/ui/splat/splat-const-fn-tuple.rs b/tests/ui/splat/splat-const-fn-tuple.rs index f4ae2e124a72d..5a8526c41744d 100644 --- a/tests/ui/splat/splat-const-fn-tuple.rs +++ b/tests/ui/splat/splat-const-fn-tuple.rs @@ -1,10 +1,10 @@ //@ run-pass -//! Test using `#[splat]` on tuple arguments of const functions. +//! Test using `#[arg_splat]` on tuple arguments of const functions. #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] -const fn sum(#[splat] (a, b): (u32, u32)) -> u32 { +const fn sum(#[arg_splat] (a, b): (u32, u32)) -> u32 { a + b } diff --git a/tests/ui/splat/splat-dyn-asref-tuple-fail.rs b/tests/ui/splat/splat-dyn-asref-tuple-fail.rs index d9b3b0351281c..5661815096280 100644 --- a/tests/ui/splat/splat-dyn-asref-tuple-fail.rs +++ b/tests/ui/splat/splat-dyn-asref-tuple-fail.rs @@ -1,7 +1,7 @@ -//! Test that `#[splat]` on `&dyn AsRef` where `T: Tuple` is an error. +//! Test that `#[arg_splat]` on `&dyn AsRef` where `T: Tuple` is an error. #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] #![feature(tuple_trait)] // Strip binders and their lifetime numbers from error messages @@ -9,7 +9,7 @@ // FIXME(splat): Some errors are reported on the callee, but they would be more ergonomic on the // caller as well -fn dyn_asref_splat(#[splat] _t: &dyn AsRef) +fn dyn_asref_splat(#[arg_splat] _t: &dyn AsRef) //~^ ERROR cannot use splat attribute; the splatted argument type must be a tuple or unit, not a //~| ERROR cannot use splat attribute; the splatted argument type must be a tuple or unit, not a //~| ERROR cannot use splat attribute; the splatted argument type must be a tuple or unit, not a diff --git a/tests/ui/splat/splat-dyn-asref-tuple-fail.stderr b/tests/ui/splat/splat-dyn-asref-tuple-fail.stderr index e9388eee63de0..cbef80f8334fc 100644 --- a/tests/ui/splat/splat-dyn-asref-tuple-fail.stderr +++ b/tests/ui/splat/splat-dyn-asref-tuple-fail.stderr @@ -1,8 +1,8 @@ error[E0277]: cannot use splat attribute; the splatted argument type must be a tuple or unit, not a Trait(std::convert::AsRef) - --> $DIR/splat-dyn-asref-tuple-fail.rs:12:36 + --> $DIR/splat-dyn-asref-tuple-fail.rs:12:40 | -LL | fn dyn_asref_splat(#[splat] _t: &dyn AsRef) - | ^^^^^^^^^^^^^ +LL | fn dyn_asref_splat(#[arg_splat] _t: &dyn AsRef) + | ^^^^^^^^^^^^^ ... LL | dyn_asref_splat::(&s); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -16,35 +16,35 @@ LL | dyn_asref_splat::(&s); note: required by a bound in `dyn_asref_splat` --> $DIR/splat-dyn-asref-tuple-fail.rs:18:8 | -LL | fn dyn_asref_splat(#[splat] _t: &dyn AsRef) +LL | fn dyn_asref_splat(#[arg_splat] _t: &dyn AsRef) | --------------- required by a bound in this function ... LL | T: std::marker::Tuple, | ^^^^^^^^^^^^^^^^^^ required by this bound in `dyn_asref_splat` error[E0277]: cannot use splat attribute; the splatted argument type must be a tuple or unit, not a Trait(std::convert::AsRef<_>) - --> $DIR/splat-dyn-asref-tuple-fail.rs:12:36 + --> $DIR/splat-dyn-asref-tuple-fail.rs:12:40 | -LL | fn dyn_asref_splat(#[splat] _t: &dyn AsRef) - | ^^^^^^^^^^^^^ +LL | fn dyn_asref_splat(#[arg_splat] _t: &dyn AsRef) + | ^^^^^^^^^^^^^ ... LL | dyn_asref_splat(&s); | ^^^^^^^^^^^^^^^^^^^ error[E0277]: cannot use splat attribute; the splatted argument type must be a tuple or unit, not a Trait(std::convert::AsRef<(u8, f32)>) - --> $DIR/splat-dyn-asref-tuple-fail.rs:12:36 + --> $DIR/splat-dyn-asref-tuple-fail.rs:12:40 | -LL | fn dyn_asref_splat(#[splat] _t: &dyn AsRef) - | ^^^^^^^^^^^^^ +LL | fn dyn_asref_splat(#[arg_splat] _t: &dyn AsRef) + | ^^^^^^^^^^^^^ ... LL | dyn_asref_splat::<(u8, f32)>(&t); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: cannot use splat attribute; the splatted argument type must be a tuple or unit, not a Trait(std::convert::AsRef<_>) - --> $DIR/splat-dyn-asref-tuple-fail.rs:12:36 + --> $DIR/splat-dyn-asref-tuple-fail.rs:12:40 | -LL | fn dyn_asref_splat(#[splat] _t: &dyn AsRef) - | ^^^^^^^^^^^^^ +LL | fn dyn_asref_splat(#[arg_splat] _t: &dyn AsRef) + | ^^^^^^^^^^^^^ ... LL | dyn_asref_splat(&t); | ^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/splat/splat-fn-ptr-cast-fail.rs b/tests/ui/splat/splat-fn-ptr-cast-fail.rs index 1cd1bdacf582c..ae4a258a939f5 100644 --- a/tests/ui/splat/splat-fn-ptr-cast-fail.rs +++ b/tests/ui/splat/splat-fn-ptr-cast-fail.rs @@ -1,15 +1,15 @@ //! Test casting splatted functions to non-splatted function pointers fails. #![allow(incomplete_features)] -#![feature(splat, tuple_trait)] +#![feature(arg_splat, tuple_trait)] use std::marker::Tuple; -fn tuple_args(#[splat] (_a, _b): (u32, i8)) {} +fn tuple_args(#[arg_splat] (_a, _b): (u32, i8)) {} -fn splat_non_terminal_arg(#[splat] (_a, _b): (u32, i8), _c: f64) {} +fn splat_non_terminal_arg(#[arg_splat] (_a, _b): (u32, i8), _c: f64) {} -fn f(#[splat] args: Args) {} +fn f(#[arg_splat] args: Args) {} fn main() { // Function pointers diff --git a/tests/ui/splat/splat-fn-ptr-cast-fail.stderr b/tests/ui/splat/splat-fn-ptr-cast-fail.stderr index 93d7c8493048d..903912c2d5441 100644 --- a/tests/ui/splat/splat-fn-ptr-cast-fail.stderr +++ b/tests/ui/splat/splat-fn-ptr-cast-fail.stderr @@ -7,7 +7,7 @@ LL | let _fn_ptr: fn((u32, i8)) = tuple_args; | expected due to this | = note: expected fn pointer `fn((_, _))` - found fn item `fn(#[splat] (_, _)) {tuple_args}` + found fn item `fn(#[arg_splat] (_, _)) {tuple_args}` error[E0308]: mismatched types --> $DIR/splat-fn-ptr-cast-fail.rs:17:39 @@ -18,15 +18,15 @@ LL | let _fn_ptr: fn((u32, i8), f64) = splat_non_terminal_arg; | expected due to this | = note: expected fn pointer `fn((_, _), _)` - found fn item `fn(#[splat] (_, _), _) {splat_non_terminal_arg}` + found fn item `fn(#[arg_splat] (_, _), _) {splat_non_terminal_arg}` -error[E0605]: non-primitive cast: `fn(, #[splat](u32, i8)) {tuple_args}` as `fn((u32, i8))` +error[E0605]: non-primitive cast: `fn(, #[arg_splat](u32, i8)) {tuple_args}` as `fn((u32, i8))` --> $DIR/splat-fn-ptr-cast-fail.rs:19:34 | LL | let _fn_ptr: fn((u32, i8)) = tuple_args as fn((u32, i8)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid cast -error[E0605]: non-primitive cast: `fn(, #[splat](u32, i8), f64) {splat_non_terminal_arg}` as `fn((u32, i8), f64)` +error[E0605]: non-primitive cast: `fn(, #[arg_splat](u32, i8), f64) {splat_non_terminal_arg}` as `fn((u32, i8), f64)` --> $DIR/splat-fn-ptr-cast-fail.rs:20:39 | LL | let _fn_ptr: fn((u32, i8), f64) = splat_non_terminal_arg as fn((u32, i8), f64); @@ -41,7 +41,7 @@ LL | const _F2: fn((u8, u32)) = f::<(u8, u32)>; | expected because of the type of the constant | = note: expected fn pointer `fn((_, _))` - found fn item `fn(#[splat] (_, _)) {f::<(u8, u32)>}` + found fn item `fn(#[arg_splat] (_, _)) {f::<(u8, u32)>}` error[E0308]: mismatched types --> $DIR/splat-fn-ptr-cast-fail.rs:24:35 @@ -52,7 +52,7 @@ LL | const _F1: fn(((u8, u32),)) = f::<((u8, u32),)>; | expected because of the type of the constant | = note: expected fn pointer `fn(((_, _),))` - found fn item `fn(#[splat] ((_, _),)) {f::<((u8, u32),)>}` + found fn item `fn(#[arg_splat] ((_, _),)) {f::<((u8, u32),)>}` error: aborting due to 6 previous errors diff --git a/tests/ui/splat/splat-fn-ptr-cast.rs b/tests/ui/splat/splat-fn-ptr-cast.rs index 918e26c4dd741..48e8158a6e837 100644 --- a/tests/ui/splat/splat-fn-ptr-cast.rs +++ b/tests/ui/splat/splat-fn-ptr-cast.rs @@ -2,13 +2,13 @@ //! Test never type casts to splatted and non-splatted functions. #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] #![allow(unused_features)] fn main() { // Bug #158603 regression test variants #[rustfmt::skip] - let _x: fn(#[splat] (f32,)) = None.unwrap(); + let _x: fn(#[arg_splat] (f32,)) = None.unwrap(); // FIXME(splat): causes an ICE until #158603 is fixed //x(1.0); diff --git a/tests/ui/splat/splat-fn-ptr-ptr-tuple.rs b/tests/ui/splat/splat-fn-ptr-ptr-tuple.rs index 321511f270915..f57656ba3ee71 100644 --- a/tests/ui/splat/splat-fn-ptr-ptr-tuple.rs +++ b/tests/ui/splat/splat-fn-ptr-ptr-tuple.rs @@ -1,4 +1,4 @@ -//! Test using `#[splat]` on tuple arguments of pointers to pointers to simple functions. +//! Test using `#[arg_splat]` on tuple arguments of pointers to pointers to simple functions. //! Currently ICEs, but if we fix it, we'll want to know and update this test to pass. //@ failure-status: 101 @@ -14,18 +14,18 @@ //@ normalize-stderr: ".*--> .*/splat-fn-ptr-tuple.rs:\d{1,}:\d{1,}.*\n" -> "" #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] -fn tuple_args(#[splat] (_a, _b): (u32, i8)) {} +fn tuple_args(#[arg_splat] (_a, _b): (u32, i8)) {} -fn splat_non_terminal_arg(#[splat] (_a, _b): (u32, i8), _c: f64) {} +fn splat_non_terminal_arg(#[arg_splat] (_a, _b): (u32, i8), _c: f64) {} fn main() { // FIXME(splat): not currently supported, can be supported when we no longer require a DefId in // MIR lowering // FIXME(rustfmt): the attribute gets deleted by rustfmt #[rustfmt::skip] - let fn_pp: *const fn(#[splat] (u32, i8)) = tuple_args as *const fn(#[splat] (u32, i8)); + let fn_pp: *const fn(#[arg_splat] (u32, i8)) = tuple_args as *const fn(#[arg_splat] (u32, i8)); unsafe { (*fn_pp)(1, 2); //~ ERROR splatted FnPtr side-tables are not yet implemented // The ICE means that code after this line is not fully checked @@ -33,8 +33,8 @@ fn main() { } #[rustfmt::skip] - let fn_pp: *const fn(#[splat] (u32, i8), f64) = - splat_non_terminal_arg as *const fn(#[splat] (u32, i8), f64); + let fn_pp: *const fn(#[arg_splat] (u32, i8), f64) = + splat_non_terminal_arg as *const fn(#[arg_splat] (u32, i8), f64); unsafe { (*fn_pp)(1, 2, 3.5); (*fn_pp)(1u32, 2i8, 3.5f64); diff --git a/tests/ui/splat/splat-fn-ptr-rust-call.rs b/tests/ui/splat/splat-fn-ptr-rust-call.rs index a9fe48a459d8a..240d315c58780 100644 --- a/tests/ui/splat/splat-fn-ptr-rust-call.rs +++ b/tests/ui/splat/splat-fn-ptr-rust-call.rs @@ -1,18 +1,18 @@ -//! Test using `#[splat]` on tuple arguments of pointers to "rust-call" functions. +//! Test using `#[arg_splat]` on tuple arguments of pointers to "rust-call" functions. //! Currently ICEs at a later stage, but AST validation should catch it earlier. #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] #![feature(unboxed_closures)] -extern "rust-call" fn f(#[splat] _: ()) {} //~ ERROR `#[splat]` is not allowed in the arguments of functions with the `rust-call` ABI +extern "rust-call" fn f(#[arg_splat] _: ()) {} //~ ERROR `#[arg_splat]` is not allowed in the arguments of functions with the `rust-call` ABI fn main() { // FIXME(rustfmt): the attribute gets deleted by rustfmt #[rustfmt::skip] - let f2: extern "rust-call" fn(#[splat] ()) = f; //~ ERROR `#[splat]` is not allowed in the arguments of functions with the `rust-call` ABI + let f2: extern "rust-call" fn(#[arg_splat] ()) = f; //~ ERROR `#[arg_splat]` is not allowed in the arguments of functions with the `rust-call` ABI // These errors could be confusing, but they're useful if the user meant to use "rust-call" - // instead of #[splat] + // instead of #[arg_splat] f(); //~ ERROR functions with the "rust-call" ABI must take a single non-self tuple argument f2(); //~ ERROR functions with the "rust-call" ABI must take a single non-self tuple argument } diff --git a/tests/ui/splat/splat-fn-ptr-rust-call.stderr b/tests/ui/splat/splat-fn-ptr-rust-call.stderr index 6eacdfab5faac..376fb9e4a1182 100644 --- a/tests/ui/splat/splat-fn-ptr-rust-call.stderr +++ b/tests/ui/splat/splat-fn-ptr-rust-call.stderr @@ -1,18 +1,18 @@ -error: `#[splat]` is not allowed in the arguments of functions with the `rust-call` ABI +error: `#[arg_splat]` is not allowed in the arguments of functions with the `rust-call` ABI --> $DIR/splat-fn-ptr-rust-call.rs:8:1 | -LL | extern "rust-call" fn f(#[splat] _: ()) {} - | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^ +LL | extern "rust-call" fn f(#[arg_splat] _: ()) {} + | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ | - = help: remove `#[splat]` or change the ABI + = help: remove `#[arg_splat]` or change the ABI -error: `#[splat]` is not allowed in the arguments of functions with the `rust-call` ABI +error: `#[arg_splat]` is not allowed in the arguments of functions with the `rust-call` ABI --> $DIR/splat-fn-ptr-rust-call.rs:13:13 | -LL | let f2: extern "rust-call" fn(#[splat] ()) = f; - | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^ +LL | let f2: extern "rust-call" fn(#[arg_splat] ()) = f; + | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ | - = help: remove `#[splat]` or change the ABI + = help: remove `#[arg_splat]` or change the ABI error: functions with the "rust-call" ABI must take a single non-self tuple argument --> $DIR/splat-fn-ptr-rust-call.rs:16:5 diff --git a/tests/ui/splat/splat-fn-ptr-tuple-const.rs b/tests/ui/splat/splat-fn-ptr-tuple-const.rs index faf8501cc650a..18ac3735c438a 100644 --- a/tests/ui/splat/splat-fn-ptr-tuple-const.rs +++ b/tests/ui/splat/splat-fn-ptr-tuple-const.rs @@ -1,4 +1,4 @@ -//! Test using `#[splat]` on tuple arguments of generic function constants. +//! Test using `#[arg_splat]` on tuple arguments of generic function constants. //! Currently ICEs (#158603), but if we fix it, we'll want to know and update this test to pass. //@ failure-status: 101 @@ -14,21 +14,21 @@ //@ normalize-stderr: ".*--> .*/splat-fn-ptr-tuple.rs:\d{1,}:\d{1,}.*\n" -> "" #![allow(incomplete_features)] -#![feature(splat, tuple_trait)] +#![feature(arg_splat, tuple_trait)] use std::marker::Tuple; -fn f(#[splat] args: Args) {} +fn f(#[arg_splat] args: Args) {} fn main() { // FIXME(splat): not currently supported, can be supported when we no longer require a DefId in // MIR lowering // FIXME(rustfmt): the attribute gets deleted by rustfmt #[rustfmt::skip] - const F2: fn(#[splat] (u8, u32)) = f::<(u8, u32)>; + const F2: fn(#[arg_splat] (u8, u32)) = f::<(u8, u32)>; const R2: () = F2(1, 2); //~ ERROR splatted FnPtr side-tables are not yet implemented #[rustfmt::skip] - const F1: fn(#[splat] ((u8, u32),)) = f::<((u8, u32),)>; + const F1: fn(#[arg_splat] ((u8, u32),)) = f::<((u8, u32),)>; const R1: () = F1((1, 2)); //~ ERROR splatted FnPtr side-tables are not yet implemented } diff --git a/tests/ui/splat/splat-fn-ptr-tuple.rs b/tests/ui/splat/splat-fn-ptr-tuple.rs index 395d30baedaaf..c946d8ba28d11 100644 --- a/tests/ui/splat/splat-fn-ptr-tuple.rs +++ b/tests/ui/splat/splat-fn-ptr-tuple.rs @@ -1,4 +1,4 @@ -//! Test using `#[splat]` on tuple arguments of pointers to simple functions. +//! Test using `#[arg_splat]` on tuple arguments of pointers to simple functions. //! Currently ICEs, but if we fix it, we'll want to know and update this test to pass. //@ failure-status: 101 @@ -14,18 +14,18 @@ //@ normalize-stderr: ".*--> .*/splat-fn-ptr-tuple.rs:\d{1,}:\d{1,}.*\n" -> "" #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] -fn tuple_args(#[splat] (_a, _b): (u32, i8)) {} +fn tuple_args(#[arg_splat] (_a, _b): (u32, i8)) {} -fn splat_non_terminal_arg(#[splat] (_a, _b): (u32, i8), _c: f64) {} +fn splat_non_terminal_arg(#[arg_splat] (_a, _b): (u32, i8), _c: f64) {} fn main() { // FIXME(splat): not currently supported, can be supported when we no longer require a DefId in // MIR lowering // FIXME(rustfmt): the attribute gets deleted by rustfmt #[rustfmt::skip] - let fn_ptr: fn(#[splat] (u32, i8)) = tuple_args; + let fn_ptr: fn(#[arg_splat] (u32, i8)) = tuple_args; fn_ptr(1, 2); //~ ERROR splatted FnPtr side-tables are not yet implemented // The ICE means that code after this line is not fully checked fn_ptr(1u32, 2i8); @@ -35,12 +35,12 @@ fn main() { //fn_ptr((1, 2)); // ERROR this splatted function takes 2 arguments, but 1 was provided #[rustfmt::skip] - let fn_ptr: fn(#[splat] (u32, i8), f64) = splat_non_terminal_arg; + let fn_ptr: fn(#[arg_splat] (u32, i8), f64) = splat_non_terminal_arg; fn_ptr(1, 2, 3.5); fn_ptr(1u32, 2i8, 3.5f64); // Bug #158603 regression test #[rustfmt::skip] - let x: fn(#[splat] (i32,)) = None.unwrap(); + let x: fn(#[arg_splat] (i32,)) = None.unwrap(); x(1); } diff --git a/tests/ui/splat/splat-fn-tuple-generic-fail.rs b/tests/ui/splat/splat-fn-tuple-generic-fail.rs index 17e8e46db0672..6516f698d2f51 100644 --- a/tests/ui/splat/splat-fn-tuple-generic-fail.rs +++ b/tests/ui/splat/splat-fn-tuple-generic-fail.rs @@ -1,14 +1,14 @@ -//! Test failing use of `#[splat]` on tuple trait arguments of generic functions. +//! Test failing use of `#[arg_splat]` on tuple trait arguments of generic functions. #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] #![feature(tuple_trait)] use std::marker::Tuple; -fn splat_generic_tuple(#[splat] _t: T) {} +fn splat_generic_tuple(#[arg_splat] _t: T) {} -fn f(#[splat] args: Args) {} +fn f(#[arg_splat] args: Args) {} fn main() { // FIXME(splat): should splatted functions be callable with tupled and un-tupled arguments? diff --git a/tests/ui/splat/splat-fn-tuple-generic-fail.stderr b/tests/ui/splat/splat-fn-tuple-generic-fail.stderr index c4fc6aa1d56c1..92ddb00bef860 100644 --- a/tests/ui/splat/splat-fn-tuple-generic-fail.stderr +++ b/tests/ui/splat/splat-fn-tuple-generic-fail.stderr @@ -43,7 +43,7 @@ LL | const F1: fn((u8, u32)) = f::<(u8, u32)>; | expected because of the type of the constant | = note: expected fn pointer `fn((_, _))` - found fn item `fn(#[splat] (_, _)) {f::<(u8, u32)>}` + found fn item `fn(#[arg_splat] (_, _)) {f::<(u8, u32)>}` error: aborting due to 7 previous errors diff --git a/tests/ui/splat/splat-fn-tuple-generic.rs b/tests/ui/splat/splat-fn-tuple-generic.rs index b7e3615f62c45..c1e82237c17cd 100644 --- a/tests/ui/splat/splat-fn-tuple-generic.rs +++ b/tests/ui/splat/splat-fn-tuple-generic.rs @@ -1,11 +1,11 @@ //@ run-pass -//! Test using `#[splat]` on tuple trait arguments of generic functions. +//! Test using `#[arg_splat]` on tuple trait arguments of generic functions. #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] #![feature(tuple_trait)] -fn splat_generic_tuple(#[splat] _t: T) {} +fn splat_generic_tuple(#[arg_splat] _t: T) {} fn main() { // Calling with un-splatted arguments might look like it works, but the actual generic type is diff --git a/tests/ui/splat/splat-fn-tuple-simple.rs b/tests/ui/splat/splat-fn-tuple-simple.rs index c7234a15b9d55..8b9fe19b9b7b4 100644 --- a/tests/ui/splat/splat-fn-tuple-simple.rs +++ b/tests/ui/splat/splat-fn-tuple-simple.rs @@ -1,12 +1,12 @@ //@ run-pass -//! Test using `#[splat]` on tuple arguments of simple functions. +//! Test using `#[arg_splat]` on tuple arguments of simple functions. #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] -fn tuple_args(#[splat] (_a, _b): (u32, i8)) {} +fn tuple_args(#[arg_splat] (_a, _b): (u32, i8)) {} -fn splat_non_terminal_arg(#[splat] (_a, _b): (u32, i8), _c: f64) {} +fn splat_non_terminal_arg(#[arg_splat] (_a, _b): (u32, i8), _c: f64) {} fn main() { tuple_args(1, 2); diff --git a/tests/ui/splat/splat-generics-complex-types.rs b/tests/ui/splat/splat-generics-complex-types.rs index 7d4490c18da75..1ea37f8464c9b 100644 --- a/tests/ui/splat/splat-generics-complex-types.rs +++ b/tests/ui/splat/splat-generics-complex-types.rs @@ -1,17 +1,17 @@ //@ run-pass -//! Test using `#[splat]` on tuples with complex generic types inside the splatted tuple. +//! Test using `#[arg_splat]` on tuples with complex generic types inside the splatted tuple. #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] // Vec and Option inside splatted tuple -fn nested_generic(#[splat] _: (Vec, Option)) {} +fn nested_generic(#[arg_splat] _: (Vec, Option)) {} // Box inside splatted tuple -fn box_generic(#[splat] _: (Box, u32)) {} +fn box_generic(#[arg_splat] _: (Box, u32)) {} // Multiple complex generics -fn multi_generic(#[splat] _: (Vec, Option, Box)) {} +fn multi_generic(#[arg_splat] _: (Vec, Option, Box)) {} fn main() { nested_generic(vec![1u32, 2u32], Some(2i8)); diff --git a/tests/ui/splat/splat-generics-everywhere.rs b/tests/ui/splat/splat-generics-everywhere.rs index 90335ad31f938..6117d9df74ff4 100644 --- a/tests/ui/splat/splat-generics-everywhere.rs +++ b/tests/ui/splat/splat-generics-everywhere.rs @@ -1,8 +1,8 @@ //@ run-pass -//! Test using `#[splat]` on tuples with generics in various positions. +//! Test using `#[arg_splat]` on tuples with generics in various positions. #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] #![feature(tuple_trait)] struct Foo(T); @@ -12,45 +12,45 @@ impl Foo { Self(t) } - fn assoc(_u: U, #[splat] _s: ()) {} + fn assoc(_u: U, #[arg_splat] _s: ()) {} - fn method(&self, _v: V, #[splat] _s: (u32, f64)) {} + fn method(&self, _v: V, #[arg_splat] _s: (u32, f64)) {} - fn lifetime<'a>(&self, #[splat] _s: (u32, f64, &'a str)) {} + fn lifetime<'a>(&self, #[arg_splat] _s: (u32, f64, &'a str)) {} - fn const_generic(&self, #[splat] _s: (u32, f64, [u8; N])) {} + fn const_generic(&self, #[arg_splat] _s: (u32, f64, [u8; N])) {} - fn generic_in_tuple(&self, #[splat] _s: (U, u32)) {} + fn generic_in_tuple(&self, #[arg_splat] _s: (U, u32)) {} - fn generic_tuple_assoc(_u: U, #[splat] _s: ()) {} + fn generic_tuple_assoc(_u: U, #[arg_splat] _s: ()) {} } trait BarTrait { - fn trait_assoc(w: W, #[splat] _s: ()); + fn trait_assoc(w: W, #[arg_splat] _s: ()); - fn trait_method(&self, x: X, #[splat] _s: (u32, f64)); + fn trait_method(&self, x: X, #[arg_splat] _s: (u32, f64)); - fn trait_lifetime<'a>(&self, #[splat] _s: (u32, f64, &'a str)) {} + fn trait_lifetime<'a>(&self, #[arg_splat] _s: (u32, f64, &'a str)) {} - fn trait_const_generic(&self, #[splat] _s: (u32, f64, [u8; N])) {} + fn trait_const_generic(&self, #[arg_splat] _s: (u32, f64, [u8; N])) {} - fn trait_generic_in_tuple(&self, #[splat] _s: (T, U)) {} + fn trait_generic_in_tuple(&self, #[arg_splat] _s: (T, U)) {} - fn trait_generic_tuple(&self, #[splat] _s: U) {} + fn trait_generic_tuple(&self, #[arg_splat] _s: U) {} } impl BarTrait for Foo { - fn trait_assoc(_w: W, #[splat] _s: ()) {} + fn trait_assoc(_w: W, #[arg_splat] _s: ()) {} - fn trait_method(&self, _x: X, #[splat] _s: (u32, f64)) {} + fn trait_method(&self, _x: X, #[arg_splat] _s: (u32, f64)) {} - fn trait_lifetime<'a>(&self, #[splat] _s: (u32, f64, &'a str)) {} + fn trait_lifetime<'a>(&self, #[arg_splat] _s: (u32, f64, &'a str)) {} - fn trait_const_generic(&self, #[splat] _s: (u32, f64, [u8; N])) {} + fn trait_const_generic(&self, #[arg_splat] _s: (u32, f64, [u8; N])) {} - fn trait_generic_in_tuple(&self, #[splat] _s: (T, U)) {} + fn trait_generic_in_tuple(&self, #[arg_splat] _s: (T, U)) {} - fn trait_generic_tuple(&self, #[splat] _s: U) {} + fn trait_generic_tuple(&self, #[arg_splat] _s: U) {} } fn main() { diff --git a/tests/ui/splat/splat-generics-inside-tuple.rs b/tests/ui/splat/splat-generics-inside-tuple.rs index dce26e55fa2d9..add3a6c1a8ce6 100644 --- a/tests/ui/splat/splat-generics-inside-tuple.rs +++ b/tests/ui/splat/splat-generics-inside-tuple.rs @@ -1,15 +1,15 @@ //@ run-pass -//! Test using `#[splat]` on tuples with generics inside the splatted tuple. +//! Test using `#[arg_splat]` on tuples with generics inside the splatted tuple. #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] -fn generic_second(#[splat] _s: (u32, T)) {} +fn generic_second(#[arg_splat] _s: (u32, T)) {} -fn generic_first(#[splat] _s: (T, u32)) {} +fn generic_first(#[arg_splat] _s: (T, u32)) {} -fn generic_both(#[splat] _s: (T, U)) {} +fn generic_both(#[arg_splat] _s: (T, U)) {} -fn generic_triple(#[splat] _s: (T, U, V)) {} +fn generic_triple(#[arg_splat] _s: (T, U, V)) {} fn main() { generic_second(1u32, 2i8); diff --git a/tests/ui/splat/splat-invalid-trait-impl.rs b/tests/ui/splat/splat-invalid-trait-impl.rs index fe0d5ddc5a1c8..645d2a757fd3a 100644 --- a/tests/ui/splat/splat-invalid-trait-impl.rs +++ b/tests/ui/splat/splat-invalid-trait-impl.rs @@ -1,9 +1,9 @@ -//! Test that `#[splat]` trait impls with mismatched tuple element types are rejected. +//! Test that `#[arg_splat]` trait impls with mismatched tuple element types are rejected. #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] trait FooTrait { - fn method(#[splat] _: (u32, i8)); + fn method(#[arg_splat] _: (u32, i8)); } struct Foo; @@ -11,17 +11,17 @@ struct Foo1; struct Foo2; impl FooTrait for Foo { - fn method(#[splat] _: (u32, f32)) {} + fn method(#[arg_splat] _: (u32, f32)) {} //~^ ERROR method `method` has an incompatible type for trait } impl FooTrait for Foo1 { - fn method(#[splat] _: (f32, i8)) {} + fn method(#[arg_splat] _: (f32, i8)) {} //~^ ERROR method `method` has an incompatible type for trait } impl FooTrait for Foo2 { - fn method(#[splat] _: (f32, f64)) {} + fn method(#[arg_splat] _: (f32, f64)) {} //~^ ERROR method `method` has an incompatible type for trait } fn main() {} diff --git a/tests/ui/splat/splat-invalid-trait-impl.stderr b/tests/ui/splat/splat-invalid-trait-impl.stderr index 684cc65d7a326..72711f5b4cfe8 100644 --- a/tests/ui/splat/splat-invalid-trait-impl.stderr +++ b/tests/ui/splat/splat-invalid-trait-impl.stderr @@ -1,58 +1,58 @@ error[E0053]: method `method` has an incompatible type for trait - --> $DIR/splat-invalid-trait-impl.rs:14:27 + --> $DIR/splat-invalid-trait-impl.rs:14:31 | -LL | fn method(#[splat] _: (u32, f32)) {} - | ^^^^^^^^^^ expected `i8`, found `f32` +LL | fn method(#[arg_splat] _: (u32, f32)) {} + | ^^^^^^^^^^ expected `i8`, found `f32` | note: type in trait - --> $DIR/splat-invalid-trait-impl.rs:6:27 + --> $DIR/splat-invalid-trait-impl.rs:6:31 | -LL | fn method(#[splat] _: (u32, i8)); - | ^^^^^^^^^ - = note: expected signature `fn(#[splat] (_, i8))` - found signature `fn(#[splat] (_, f32))` +LL | fn method(#[arg_splat] _: (u32, i8)); + | ^^^^^^^^^ + = note: expected signature `fn(#[arg_splat] (_, i8))` + found signature `fn(#[arg_splat] (_, f32))` help: change the parameter type to match the trait | -LL - fn method(#[splat] _: (u32, f32)) {} -LL + fn method(#[splat] _: (u32, i8)) {} +LL - fn method(#[arg_splat] _: (u32, f32)) {} +LL + fn method(#[arg_splat] _: (u32, i8)) {} | error[E0053]: method `method` has an incompatible type for trait - --> $DIR/splat-invalid-trait-impl.rs:19:27 + --> $DIR/splat-invalid-trait-impl.rs:19:31 | -LL | fn method(#[splat] _: (f32, i8)) {} - | ^^^^^^^^^ expected `u32`, found `f32` +LL | fn method(#[arg_splat] _: (f32, i8)) {} + | ^^^^^^^^^ expected `u32`, found `f32` | note: type in trait - --> $DIR/splat-invalid-trait-impl.rs:6:27 + --> $DIR/splat-invalid-trait-impl.rs:6:31 | -LL | fn method(#[splat] _: (u32, i8)); - | ^^^^^^^^^ - = note: expected signature `fn(#[splat] (u32, _))` - found signature `fn(#[splat] (f32, _))` +LL | fn method(#[arg_splat] _: (u32, i8)); + | ^^^^^^^^^ + = note: expected signature `fn(#[arg_splat] (u32, _))` + found signature `fn(#[arg_splat] (f32, _))` help: change the parameter type to match the trait | -LL - fn method(#[splat] _: (f32, i8)) {} -LL + fn method(#[splat] _: (u32, i8)) {} +LL - fn method(#[arg_splat] _: (f32, i8)) {} +LL + fn method(#[arg_splat] _: (u32, i8)) {} | error[E0053]: method `method` has an incompatible type for trait - --> $DIR/splat-invalid-trait-impl.rs:24:27 + --> $DIR/splat-invalid-trait-impl.rs:24:31 | -LL | fn method(#[splat] _: (f32, f64)) {} - | ^^^^^^^^^^ expected `u32`, found `f32` +LL | fn method(#[arg_splat] _: (f32, f64)) {} + | ^^^^^^^^^^ expected `u32`, found `f32` | note: type in trait - --> $DIR/splat-invalid-trait-impl.rs:6:27 + --> $DIR/splat-invalid-trait-impl.rs:6:31 | -LL | fn method(#[splat] _: (u32, i8)); - | ^^^^^^^^^ - = note: expected signature `fn(#[splat] (u32, i8))` - found signature `fn(#[splat] (f32, f64))` +LL | fn method(#[arg_splat] _: (u32, i8)); + | ^^^^^^^^^ + = note: expected signature `fn(#[arg_splat] (u32, i8))` + found signature `fn(#[arg_splat] (f32, f64))` help: change the parameter type to match the trait | -LL - fn method(#[splat] _: (f32, f64)) {} -LL + fn method(#[splat] _: (u32, i8)) {} +LL - fn method(#[arg_splat] _: (f32, f64)) {} +LL + fn method(#[arg_splat] _: (u32, i8)) {} | error: aborting due to 3 previous errors diff --git a/tests/ui/splat/splat-invalid.rs b/tests/ui/splat/splat-invalid.rs index b8dd5738c32bf..de52d43343b85 100644 --- a/tests/ui/splat/splat-invalid.rs +++ b/tests/ui/splat/splat-invalid.rs @@ -1,54 +1,54 @@ -//! Test using `#[splat]` incorrectly, in ways not covered by other tests. +//! Test using `#[arg_splat]` incorrectly, in ways not covered by other tests. #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] -fn multisplat_fn_bad(#[splat] (_a, _b): (u32, i8), #[splat] (_c, _d): (u32, i8)) {} -//~^ ERROR multiple `#[splat]`s are not allowed in the same function argument list +fn multisplat_fn_bad(#[arg_splat] (_a, _b): (u32, i8), #[arg_splat] (_c, _d): (u32, i8)) {} +//~^ ERROR multiple `#[arg_splat]`s are not allowed in the same function argument list fn multisplat_arg_bad( - #[splat] - #[splat] - //~^ ERROR multiple `splat` attributes + #[arg_splat] + #[arg_splat] + //~^ ERROR multiple `arg_splat` attributes (_a, _b): (u32, i8), ) { } fn multisplat_arg_fn_bad( - #[splat] - //~^ ERROR multiple `#[splat]`s are not allowed in the same function argument list - #[splat] - //~^ ERROR multiple `splat` attributes + #[arg_splat] + //~^ ERROR multiple `#[arg_splat]`s are not allowed in the same function argument list + #[arg_splat] + //~^ ERROR multiple `arg_splat` attributes (_a, _b): (u32, i8), - #[splat] (_c, _d): (u32, i8), + #[arg_splat] (_c, _d): (u32, i8), ) { } -unsafe extern "C" fn splat_variadic(#[splat] (_a, _b): (u32, i8), varargs: ...) {} -//~^ ERROR `...` and `#[splat]` are not allowed in the same function argument list +unsafe extern "C" fn splat_variadic(#[arg_splat] (_a, _b): (u32, i8), varargs: ...) {} +//~^ ERROR `...` and `#[arg_splat]` are not allowed in the same function argument list -unsafe extern "C" fn splat_variadic2(varargs: ..., #[splat] (_a, _b): (u32, i8)) {} -//~^ ERROR `...` and `#[splat]` are not allowed in the same function argument list +unsafe extern "C" fn splat_variadic2(varargs: ..., #[arg_splat] (_a, _b): (u32, i8)) {} +//~^ ERROR `...` and `#[arg_splat]` are not allowed in the same function argument list //~| ERROR `...` must be the last argument of a C-variadic function extern "C" { - fn splat_variadic3(#[splat] (_a, _b): (u32, i8), ...) {} + fn splat_variadic3(#[arg_splat] (_a, _b): (u32, i8), ...) {} //~^ ERROR incorrect function inside `extern` block - //~| ERROR `...` and `#[splat]` are not allowed in the same function + //~| ERROR `...` and `#[arg_splat]` are not allowed in the same function - fn splat_variadic4(..., #[splat] (_a, _b): (u32, i8)) {} + fn splat_variadic4(..., #[arg_splat] (_a, _b): (u32, i8)) {} //~^ ERROR incorrect function inside `extern` block - //~| ERROR `...` and `#[splat]` are not allowed in the same function + //~| ERROR `...` and `#[arg_splat]` are not allowed in the same function //~| ERROR `...` must be the last argument of a C-variadic function // FIXME(splat): tuple layouts are unspecified. Should this error in addition to // the existing `improper_ctypes` lint? #[expect(improper_ctypes)] - fn bar_2(#[splat] _: (u32, i8)); + fn bar_2(#[arg_splat] _: (u32, i8)); } trait FooTrait { - fn has_splat(#[splat] _: ()); + fn has_splat(#[arg_splat] _: ()); fn no_splat(_: (u32, f64)); } @@ -58,7 +58,7 @@ struct Foo; impl FooTrait for Foo { fn has_splat(_: ()) {} //~ ERROR method `has_splat` has an incompatible type for trait - fn no_splat(#[splat] _: (u32, f64)) {} //~ ERROR method `no_splat` has an incompatible type for trait + fn no_splat(#[arg_splat] _: (u32, f64)) {} //~ ERROR method `no_splat` has an incompatible type for trait } fn main() {} diff --git a/tests/ui/splat/splat-invalid.stderr b/tests/ui/splat/splat-invalid.stderr index 035393c65c9e5..c1edf0e31cba8 100644 --- a/tests/ui/splat/splat-invalid.stderr +++ b/tests/ui/splat/splat-invalid.stderr @@ -1,65 +1,65 @@ -error: multiple `#[splat]`s are not allowed in the same function argument list +error: multiple `#[arg_splat]`s are not allowed in the same function argument list --> $DIR/splat-invalid.rs:6:22 | -LL | fn multisplat_fn_bad(#[splat] (_a, _b): (u32, i8), #[splat] (_c, _d): (u32, i8)) {} - | ^^^^^^^^ ^^^^^^^^ +LL | fn multisplat_fn_bad(#[arg_splat] (_a, _b): (u32, i8), #[arg_splat] (_c, _d): (u32, i8)) {} + | ^^^^^^^^^^^^ ^^^^^^^^^^^^ | - = help: remove `#[splat]` from all but one argument + = help: remove `#[arg_splat]` from all but one argument -error: multiple `#[splat]`s are not allowed in the same function argument list +error: multiple `#[arg_splat]`s are not allowed in the same function argument list --> $DIR/splat-invalid.rs:18:5 | -LL | #[splat] - | ^^^^^^^^ +LL | #[arg_splat] + | ^^^^^^^^^^^^ LL | -LL | #[splat] - | ^^^^^^^^ +LL | #[arg_splat] + | ^^^^^^^^^^^^ ... -LL | #[splat] (_c, _d): (u32, i8), - | ^^^^^^^^ +LL | #[arg_splat] (_c, _d): (u32, i8), + | ^^^^^^^^^^^^ | - = help: remove `#[splat]` from all but one argument + = help: remove `#[arg_splat]` from all but one argument -error: `...` and `#[splat]` are not allowed in the same function argument list +error: `...` and `#[arg_splat]` are not allowed in the same function argument list --> $DIR/splat-invalid.rs:27:37 | -LL | unsafe extern "C" fn splat_variadic(#[splat] (_a, _b): (u32, i8), varargs: ...) {} - | ^^^^^^^^ ^^^^^^^^^^^^ +LL | unsafe extern "C" fn splat_variadic(#[arg_splat] (_a, _b): (u32, i8), varargs: ...) {} + | ^^^^^^^^^^^^ ^^^^^^^^^^^^ | - = help: remove `#[splat]` or remove `...` + = help: remove `#[arg_splat]` or remove `...` error: `...` must be the last argument of a C-variadic function --> $DIR/splat-invalid.rs:30:38 | -LL | unsafe extern "C" fn splat_variadic2(varargs: ..., #[splat] (_a, _b): (u32, i8)) {} +LL | unsafe extern "C" fn splat_variadic2(varargs: ..., #[arg_splat] (_a, _b): (u32, i8)) {} | ^^^^^^^^^^^^ -error: `...` and `#[splat]` are not allowed in the same function argument list +error: `...` and `#[arg_splat]` are not allowed in the same function argument list --> $DIR/splat-invalid.rs:30:38 | -LL | unsafe extern "C" fn splat_variadic2(varargs: ..., #[splat] (_a, _b): (u32, i8)) {} - | ^^^^^^^^^^^^ ^^^^^^^^ +LL | unsafe extern "C" fn splat_variadic2(varargs: ..., #[arg_splat] (_a, _b): (u32, i8)) {} + | ^^^^^^^^^^^^ ^^^^^^^^^^^^ | - = help: remove `#[splat]` or remove `...` + = help: remove `#[arg_splat]` or remove `...` error: incorrect function inside `extern` block --> $DIR/splat-invalid.rs:35:8 | LL | extern "C" { | ---------- `extern` blocks define existing foreign functions and functions inside of them cannot have a body -LL | fn splat_variadic3(#[splat] (_a, _b): (u32, i8), ...) {} - | ^^^^^^^^^^^^^^^ cannot have a body -- help: remove the invalid body: `;` +LL | fn splat_variadic3(#[arg_splat] (_a, _b): (u32, i8), ...) {} + | ^^^^^^^^^^^^^^^ cannot have a body -- help: remove the invalid body: `;` | = help: you might have meant to write a function accessible through FFI, which can be done by writing `extern fn` outside of the `extern` block = note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html -error: `...` and `#[splat]` are not allowed in the same function argument list +error: `...` and `#[arg_splat]` are not allowed in the same function argument list --> $DIR/splat-invalid.rs:35:24 | -LL | fn splat_variadic3(#[splat] (_a, _b): (u32, i8), ...) {} - | ^^^^^^^^ ^^^ +LL | fn splat_variadic3(#[arg_splat] (_a, _b): (u32, i8), ...) {} + | ^^^^^^^^^^^^ ^^^ | - = help: remove `#[splat]` or remove `...` + = help: remove `#[arg_splat]` or remove `...` error: incorrect function inside `extern` block --> $DIR/splat-invalid.rs:39:8 @@ -67,8 +67,8 @@ error: incorrect function inside `extern` block LL | extern "C" { | ---------- `extern` blocks define existing foreign functions and functions inside of them cannot have a body ... -LL | fn splat_variadic4(..., #[splat] (_a, _b): (u32, i8)) {} - | ^^^^^^^^^^^^^^^ cannot have a body -- help: remove the invalid body: `;` +LL | fn splat_variadic4(..., #[arg_splat] (_a, _b): (u32, i8)) {} + | ^^^^^^^^^^^^^^^ cannot have a body -- help: remove the invalid body: `;` | = help: you might have meant to write a function accessible through FFI, which can be done by writing `extern fn` outside of the `extern` block = note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html @@ -76,40 +76,40 @@ LL | fn splat_variadic4(..., #[splat] (_a, _b): (u32, i8)) {} error: `...` must be the last argument of a C-variadic function --> $DIR/splat-invalid.rs:39:24 | -LL | fn splat_variadic4(..., #[splat] (_a, _b): (u32, i8)) {} +LL | fn splat_variadic4(..., #[arg_splat] (_a, _b): (u32, i8)) {} | ^^^ -error: `...` and `#[splat]` are not allowed in the same function argument list +error: `...` and `#[arg_splat]` are not allowed in the same function argument list --> $DIR/splat-invalid.rs:39:24 | -LL | fn splat_variadic4(..., #[splat] (_a, _b): (u32, i8)) {} - | ^^^ ^^^^^^^^ +LL | fn splat_variadic4(..., #[arg_splat] (_a, _b): (u32, i8)) {} + | ^^^ ^^^^^^^^^^^^ | - = help: remove `#[splat]` or remove `...` + = help: remove `#[arg_splat]` or remove `...` -error: multiple `splat` attributes +error: multiple `arg_splat` attributes --> $DIR/splat-invalid.rs:11:5 | -LL | #[splat] - | ^^^^^^^^ help: remove this attribute +LL | #[arg_splat] + | ^^^^^^^^^^^^ help: remove this attribute | note: attribute also specified here --> $DIR/splat-invalid.rs:10:5 | -LL | #[splat] - | ^^^^^^^^ +LL | #[arg_splat] + | ^^^^^^^^^^^^ -error: multiple `splat` attributes +error: multiple `arg_splat` attributes --> $DIR/splat-invalid.rs:20:5 | -LL | #[splat] - | ^^^^^^^^ help: remove this attribute +LL | #[arg_splat] + | ^^^^^^^^^^^^ help: remove this attribute | note: attribute also specified here --> $DIR/splat-invalid.rs:18:5 | -LL | #[splat] - | ^^^^^^^^ +LL | #[arg_splat] + | ^^^^^^^^^^^^ error[E0053]: method `has_splat` has an incompatible type for trait --> $DIR/splat-invalid.rs:59:5 @@ -120,16 +120,16 @@ LL | fn has_splat(_: ()) {} note: type in trait --> $DIR/splat-invalid.rs:51:5 | -LL | fn has_splat(#[splat] _: ()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: expected signature `fn(#[splat] ())` +LL | fn has_splat(#[arg_splat] _: ()); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: expected signature `fn(#[arg_splat] ())` found signature `fn(())` error[E0053]: method `no_splat` has an incompatible type for trait --> $DIR/splat-invalid.rs:61:5 | -LL | fn no_splat(#[splat] _: (u32, f64)) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn with no splatted arg, found fn with arg 0 splatted +LL | fn no_splat(#[arg_splat] _: (u32, f64)) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn with no splatted arg, found fn with arg 0 splatted | note: type in trait --> $DIR/splat-invalid.rs:53:5 @@ -137,7 +137,7 @@ note: type in trait LL | fn no_splat(_: (u32, f64)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: expected signature `fn((_, _))` - found signature `fn(#[splat] (_, _))` + found signature `fn(#[arg_splat] (_, _))` error: aborting due to 14 previous errors diff --git a/tests/ui/splat/splat-mangling-issue-158644.rs b/tests/ui/splat/splat-mangling-issue-158644.rs index 337670ea3f179..01a37a26a4b93 100644 --- a/tests/ui/splat/splat-mangling-issue-158644.rs +++ b/tests/ui/splat/splat-mangling-issue-158644.rs @@ -7,11 +7,11 @@ //@ incremental #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] fn main() { #[rustfmt::skip] - let _x: fn(#[splat] (i32,)) = None.unwrap(); + let _x: fn(#[arg_splat] (i32,)) = None.unwrap(); let x: fn((i32,)) = None.unwrap(); x((1,)); diff --git a/tests/ui/splat/splat-mangling.legacy.stderr b/tests/ui/splat/splat-mangling.legacy.stderr index b1ecd890478e9..3c1fb0af8ff58 100644 --- a/tests/ui/splat/splat-mangling.legacy.stderr +++ b/tests/ui/splat/splat-mangling.legacy.stderr @@ -1,16 +1,16 @@ -error: symbol-name(_ZN14splat_mangling4main66Type$LT$fn$LP$$C$$u20$$u23$$u5b$splat$u5d$$LP$u8$C$u32$RP$$RP$$GT$17hCRATE_HASHE) +error: symbol-name(_ZN14splat_mangling4main70Type$LT$fn$LP$$C$$u20$$u23$$u5b$arg_splat$u5d$$LP$u8$C$u32$RP$$RP$$GT$17hCRATE_HASHE) --> $DIR/splat-mangling.rs:22:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ -error: demangling(splat_mangling::main::Type::hCRATE_HASH) +error: demangling(splat_mangling::main::Type::hCRATE_HASH) --> $DIR/splat-mangling.rs:22:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ -error: demangling-alt(splat_mangling::main::Type) +error: demangling-alt(splat_mangling::main::Type) --> $DIR/splat-mangling.rs:22:5 | LL | #[rustc_dump_symbol_name] @@ -34,19 +34,19 @@ error: demangling-alt(splat_mangling::main::Type) LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ -error: symbol-name(_ZN14splat_mangling4main77Type$LT$fn$LP$$C$$u20$$u23$$u5b$splat$u5d$$LP$$LP$u8$C$u32$RP$$C$$RP$$RP$$GT$17hCRATE_HASHE) +error: symbol-name(_ZN14splat_mangling4main81Type$LT$fn$LP$$C$$u20$$u23$$u5b$arg_splat$u5d$$LP$$LP$u8$C$u32$RP$$C$$RP$$RP$$GT$17hCRATE_HASHE) --> $DIR/splat-mangling.rs:42:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ -error: demangling(splat_mangling::main::Type::hCRATE_HASH) +error: demangling(splat_mangling::main::Type::hCRATE_HASH) --> $DIR/splat-mangling.rs:42:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ -error: demangling-alt(splat_mangling::main::Type) +error: demangling-alt(splat_mangling::main::Type) --> $DIR/splat-mangling.rs:42:5 | LL | #[rustc_dump_symbol_name] @@ -70,19 +70,19 @@ error: demangling-alt(splat_mangling::main::Type) LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ -error: symbol-name(_ZN14splat_mangling4main80Type$LT$$BP$const$u20$fn$LP$$C$$u20$$u23$$u5b$splat$u5d$$LP$u32$C$i8$RP$$RP$$GT$17hCRATE_HASHE) +error: symbol-name(_ZN14splat_mangling4main84Type$LT$$BP$const$u20$fn$LP$$C$$u20$$u23$$u5b$arg_splat$u5d$$LP$u32$C$i8$RP$$RP$$GT$17hCRATE_HASHE) --> $DIR/splat-mangling.rs:62:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ -error: demangling(splat_mangling::main::Type<*const fn(, #[splat](u32,i8))>::hCRATE_HASH) +error: demangling(splat_mangling::main::Type<*const fn(, #[arg_splat](u32,i8))>::hCRATE_HASH) --> $DIR/splat-mangling.rs:62:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ -error: demangling-alt(splat_mangling::main::Type<*const fn(, #[splat](u32,i8))>) +error: demangling-alt(splat_mangling::main::Type<*const fn(, #[arg_splat](u32,i8))>) --> $DIR/splat-mangling.rs:62:5 | LL | #[rustc_dump_symbol_name] @@ -106,19 +106,19 @@ error: demangling-alt(splat_mangling::main::Type<*const fn((u32,i8))>) LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ -error: symbol-name(_ZN14splat_mangling4main72Type$LT$fn$LP$$C$$u20$$u23$$u5b$splat$u5d$$LP$u32$C$i8$RP$$C$f64$RP$$GT$17hCRATE_HASHE) +error: symbol-name(_ZN14splat_mangling4main76Type$LT$fn$LP$$C$$u20$$u23$$u5b$arg_splat$u5d$$LP$u32$C$i8$RP$$C$f64$RP$$GT$17hCRATE_HASHE) --> $DIR/splat-mangling.rs:82:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ -error: demangling(splat_mangling::main::Type::hCRATE_HASH) +error: demangling(splat_mangling::main::Type::hCRATE_HASH) --> $DIR/splat-mangling.rs:82:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ -error: demangling-alt(splat_mangling::main::Type) +error: demangling-alt(splat_mangling::main::Type) --> $DIR/splat-mangling.rs:82:5 | LL | #[rustc_dump_symbol_name] diff --git a/tests/ui/splat/splat-mangling.rs b/tests/ui/splat/splat-mangling.rs index 0de330d5f0f65..5a53561ab1e75 100644 --- a/tests/ui/splat/splat-mangling.rs +++ b/tests/ui/splat/splat-mangling.rs @@ -11,7 +11,7 @@ //@ normalize-stderr: "::h([0-9a-f]{16})\)" -> "::hCRATE_HASH)" #![allow(incomplete_features)] -#![feature(splat, rustc_attrs)] +#![feature(arg_splat, rustc_attrs)] fn main() { struct Type(T); @@ -20,13 +20,13 @@ fn main() { #[rustfmt::skip] // FIXME(splat, legacy mangling): the first comma is in the wrong place #[rustc_dump_symbol_name] - //[legacy]~^ ERROR symbol-name(_ZN14splat_mangling4main66Type$LT$fn$LP$$C$$u20$$u23$$u5b$splat$u5d$$LP$u8$C$u32$RP$$RP$$GT - //[legacy]~| ERROR demangling(splat_mangling::main::Type:: - //[legacy]~| ERROR demangling-alt(splat_mangling::main::Type) + //[legacy]~^ ERROR symbol-name(_ZN14splat_mangling4main70Type$LT$fn$LP$$C$$u20$$u23$$u5b$arg_splat$u5d$$LP$u8$C$u32$RP$$RP$$GT + //[legacy]~| ERROR demangling(splat_mangling::main::Type:: + //[legacy]~| ERROR demangling-alt(splat_mangling::main::Type) //[v0,default]~^^^^ ERROR symbol-name(_RMNvCsCRATE_HASH_14splat_mangling4mainINtB_4TypeFwThmEEuE) //[v0,default]~| ERROR demangling(>) - impl Type {} + impl Type {} #[rustfmt::skip] #[rustc_dump_symbol_name] @@ -40,13 +40,13 @@ fn main() { #[rustfmt::skip] #[rustc_dump_symbol_name] - //[legacy]~^ ERROR symbol-name(_ZN14splat_mangling4main77Type$LT$fn$LP$$C$$u20$$u23$$u5b$splat$u5d$$LP$$LP$u8$C$u32$RP$$C$$RP$$RP$$GT - //[legacy]~| ERROR demangling(splat_mangling::main::Type:: - //[legacy]~| ERROR demangling-alt(splat_mangling::main::Type) + //[legacy]~^ ERROR symbol-name(_ZN14splat_mangling4main81Type$LT$fn$LP$$C$$u20$$u23$$u5b$arg_splat$u5d$$LP$$LP$u8$C$u32$RP$$C$$RP$$RP$$GT + //[legacy]~| ERROR demangling(splat_mangling::main::Type:: + //[legacy]~| ERROR demangling-alt(splat_mangling::main::Type) //[v0,default]~^^^^ ERROR symbol-name(_RMs0_NvCsCRATE_HASH_14splat_mangling4mainINtB_4TypeFwTThmEEEuE) //[v0,default]~| ERROR demangling(>) - impl Type {} + impl Type {} #[rustfmt::skip] #[rustc_dump_symbol_name] @@ -60,13 +60,13 @@ fn main() { #[rustfmt::skip] #[rustc_dump_symbol_name] - //[legacy]~^ ERROR symbol-name(_ZN14splat_mangling4main80Type$LT$$BP$const$u20$fn$LP$$C$$u20$$u23$$u5b$splat$u5d$$LP$u32$C$i8$RP$$RP$$GT - //[legacy]~| ERROR demangling(splat_mangling::main::Type<*const fn(, #[splat](u32,i8))>:: - //[legacy]~| ERROR demangling-alt(splat_mangling::main::Type<*const fn(, #[splat](u32,i8))>) + //[legacy]~^ ERROR symbol-name(_ZN14splat_mangling4main84Type$LT$$BP$const$u20$fn$LP$$C$$u20$$u23$$u5b$arg_splat$u5d$$LP$u32$C$i8$RP$$RP$$GT + //[legacy]~| ERROR demangling(splat_mangling::main::Type<*const fn(, #[arg_splat](u32,i8))>:: + //[legacy]~| ERROR demangling-alt(splat_mangling::main::Type<*const fn(, #[arg_splat](u32,i8))>) //[v0,default]~^^^^ ERROR symbol-name(_RMs2_NvCsCRATE_HASH_14splat_mangling4mainINtB_4TypePFwTmaEEuE) //[v0,default]~| ERROR demangling(>) - impl Type<*const fn(#[splat] (u32, i8))> {} + impl Type<*const fn(#[arg_splat] (u32, i8))> {} #[rustfmt::skip] #[rustc_dump_symbol_name] @@ -80,13 +80,13 @@ fn main() { #[rustfmt::skip] #[rustc_dump_symbol_name] - //[legacy]~^ ERROR symbol-name(_ZN14splat_mangling4main72Type$LT$fn$LP$$C$$u20$$u23$$u5b$splat$u5d$$LP$u32$C$i8$RP$$C$f64$RP$$GT - //[legacy]~| ERROR demangling(splat_mangling::main::Type:: - //[legacy]~| ERROR demangling-alt(splat_mangling::main::Type) + //[legacy]~^ ERROR symbol-name(_ZN14splat_mangling4main76Type$LT$fn$LP$$C$$u20$$u23$$u5b$arg_splat$u5d$$LP$u32$C$i8$RP$$C$f64$RP$$GT + //[legacy]~| ERROR demangling(splat_mangling::main::Type:: + //[legacy]~| ERROR demangling-alt(splat_mangling::main::Type) //[v0,default]~^^^^ ERROR symbol-name(_RMs4_NvCsCRATE_HASH_14splat_mangling4mainINtB_4TypeFwTmaEdEuE) //[v0,default]~| ERROR demangling(>) - impl Type {} + impl Type {} #[rustfmt::skip] #[rustc_dump_symbol_name] diff --git a/tests/ui/splat/splat-maybe-tuple.rs b/tests/ui/splat/splat-maybe-tuple.rs index a74af66e9a874..4f57e4f3b2422 100644 --- a/tests/ui/splat/splat-maybe-tuple.rs +++ b/tests/ui/splat/splat-maybe-tuple.rs @@ -1,11 +1,11 @@ -//! Test that using `#[splat]` on maybe-tuple generic function arguments is an error, +//! Test that using `#[arg_splat]` on maybe-tuple generic function arguments is an error, //! but only when the generics aren't tuples. #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] #![expect(unused)] -fn unbound_generic_arg(#[splat] t: T) {} //~ ERROR cannot use splat attribute; the splatted argument type must be a tuple or unit, not a u32 +fn unbound_generic_arg(#[arg_splat] t: T) {} //~ ERROR cannot use splat attribute; the splatted argument type must be a tuple or unit, not a u32 fn main() { unbound_generic_arg(); diff --git a/tests/ui/splat/splat-maybe-tuple.stderr b/tests/ui/splat/splat-maybe-tuple.stderr index 9abacdd657b93..3d447d3d62b8a 100644 --- a/tests/ui/splat/splat-maybe-tuple.stderr +++ b/tests/ui/splat/splat-maybe-tuple.stderr @@ -1,8 +1,8 @@ error[E0277]: cannot use splat attribute; the splatted argument type must be a tuple or unit, not a u32 (u32) - --> $DIR/splat-maybe-tuple.rs:8:39 + --> $DIR/splat-maybe-tuple.rs:8:43 | -LL | fn unbound_generic_arg(#[splat] t: T) {} - | ^ +LL | fn unbound_generic_arg(#[arg_splat] t: T) {} + | ^ ... LL | unbound_generic_arg::(1); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/splat/splat-method-tuple-simple.rs b/tests/ui/splat/splat-method-tuple-simple.rs index 887c9515bcdae..e1e78d8ffb0ff 100644 --- a/tests/ui/splat/splat-method-tuple-simple.rs +++ b/tests/ui/splat/splat-method-tuple-simple.rs @@ -1,17 +1,17 @@ //@ run-pass -//! Test using `#[splat]` on method tuple arguments (with receivers). +//! Test using `#[arg_splat]` on method tuple arguments (with receivers). #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] struct Foo; impl Foo { - fn tuple_2(&self, #[splat] (a, _b): (u32, i8)) -> u32 { + fn tuple_2(&self, #[arg_splat] (a, _b): (u32, i8)) -> u32 { a } - fn tuple_4(&self, #[splat] (a, _b, _c, _d): (u32, i8, (), f32)) -> u32 { + fn tuple_4(&self, #[arg_splat] (a, _b, _c, _d): (u32, i8, (), f32)) -> u32 { a } } @@ -20,7 +20,7 @@ impl Foo { struct TupleStruct(u32, i8); impl TupleStruct { - fn tuple_2(&self, #[splat] (a, _b): (u32, i8)) -> u32 { + fn tuple_2(&self, #[arg_splat] (a, _b): (u32, i8)) -> u32 { a } } diff --git a/tests/ui/splat/splat-non-fn-arg.rs b/tests/ui/splat/splat-non-fn-arg.rs index 6f2815e2b6579..6b47b9149a1ec 100644 --- a/tests/ui/splat/splat-non-fn-arg.rs +++ b/tests/ui/splat/splat-non-fn-arg.rs @@ -1,12 +1,12 @@ -//! Test that using `#[splat]` on non-function-arguments is an error. +//! Test that using `#[arg_splat]` on non-function-arguments is an error. #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] -#[splat] //~ ERROR `#[splat]` attribute cannot be used on functions +#[arg_splat] //~ ERROR `#[arg_splat]` attribute cannot be used on functions fn tuple_args_bad((a, b): (u32, i8)) {} -#[splat] //~ ERROR `#[splat]` attribute cannot be used on traits +#[arg_splat] //~ ERROR `#[arg_splat]` attribute cannot be used on traits trait FooTraitBad { fn tuple_1(_: (u32,)); @@ -15,45 +15,45 @@ trait FooTraitBad { struct Foo; -#[splat] //~ ERROR `#[splat]` attribute cannot be used on inherent impl blocks +#[arg_splat] //~ ERROR `#[arg_splat]` attribute cannot be used on inherent impl blocks impl Foo { fn tuple_1_bad((a,): (u32,)) {} } impl Foo { - #[splat] //~ ERROR `#[splat]` attribute cannot be used on inherent methods + #[arg_splat] //~ ERROR `#[arg_splat]` attribute cannot be used on inherent methods fn tuple_3_bad((a, b, c): (u32, i32, i8)) {} - #[splat] //~ ERROR `#[splat]` attribute cannot be used on inherent methods + #[arg_splat] //~ ERROR `#[arg_splat]` attribute cannot be used on inherent methods fn tuple_2_bad(self, (a, b): (u32, i8)) -> u32 { a } } -#[splat] //~ ERROR `#[splat]` attribute cannot be used on trait impl blocks +#[arg_splat] //~ ERROR `#[arg_splat]` attribute cannot be used on trait impl blocks impl FooTraitBad for Foo { fn tuple_1(_: (u32,)) {} fn tuple_4(self, _: (u32, i8, (), f32)) {} } -#[splat] //~ ERROR `#[splat]` attribute cannot be used on foreign modules +#[arg_splat] //~ ERROR `#[arg_splat]` attribute cannot be used on foreign modules extern "C" { fn foo_2(_: (u32, i8)); } extern "C" { - #[splat] //~ ERROR `#[splat]` attribute cannot be used on foreign functions + #[arg_splat] //~ ERROR `#[arg_splat]` attribute cannot be used on foreign functions fn bar_2_bad(_: (u32, i8)); } -#[splat] //~ ERROR `#[splat]` attribute cannot be used on modules +#[arg_splat] //~ ERROR `#[arg_splat]` attribute cannot be used on modules mod foo_mod {} -#[splat] //~ ERROR `#[splat]` attribute cannot be used on use statements +#[arg_splat] //~ ERROR `#[arg_splat]` attribute cannot be used on use statements use std::mem; -#[splat] //~ ERROR `#[splat]` attribute cannot be used on structs +#[arg_splat] //~ ERROR `#[arg_splat]` attribute cannot be used on structs struct FooStruct; fn main() {} diff --git a/tests/ui/splat/splat-non-fn-arg.stderr b/tests/ui/splat/splat-non-fn-arg.stderr index 089636f3d4dff..cf605d1122707 100644 --- a/tests/ui/splat/splat-non-fn-arg.stderr +++ b/tests/ui/splat/splat-non-fn-arg.stderr @@ -1,90 +1,90 @@ -error: `#[splat]` attribute cannot be used on functions +error: `#[arg_splat]` attribute cannot be used on functions --> $DIR/splat-non-fn-arg.rs:6:1 | -LL | #[splat] - | ^^^^^^^^ +LL | #[arg_splat] + | ^^^^^^^^^^^^ | - = help: `#[splat]` can only be applied to function params + = help: `#[arg_splat]` can only be applied to function params -error: `#[splat]` attribute cannot be used on traits +error: `#[arg_splat]` attribute cannot be used on traits --> $DIR/splat-non-fn-arg.rs:9:1 | -LL | #[splat] - | ^^^^^^^^ +LL | #[arg_splat] + | ^^^^^^^^^^^^ | - = help: `#[splat]` can only be applied to function params + = help: `#[arg_splat]` can only be applied to function params -error: `#[splat]` attribute cannot be used on inherent impl blocks +error: `#[arg_splat]` attribute cannot be used on inherent impl blocks --> $DIR/splat-non-fn-arg.rs:18:1 | -LL | #[splat] - | ^^^^^^^^ +LL | #[arg_splat] + | ^^^^^^^^^^^^ | - = help: `#[splat]` can only be applied to function params + = help: `#[arg_splat]` can only be applied to function params -error: `#[splat]` attribute cannot be used on inherent methods +error: `#[arg_splat]` attribute cannot be used on inherent methods --> $DIR/splat-non-fn-arg.rs:24:5 | -LL | #[splat] - | ^^^^^^^^ +LL | #[arg_splat] + | ^^^^^^^^^^^^ | - = help: `#[splat]` can only be applied to function params + = help: `#[arg_splat]` can only be applied to function params -error: `#[splat]` attribute cannot be used on inherent methods +error: `#[arg_splat]` attribute cannot be used on inherent methods --> $DIR/splat-non-fn-arg.rs:27:5 | -LL | #[splat] - | ^^^^^^^^ +LL | #[arg_splat] + | ^^^^^^^^^^^^ | - = help: `#[splat]` can only be applied to function params + = help: `#[arg_splat]` can only be applied to function params -error: `#[splat]` attribute cannot be used on trait impl blocks +error: `#[arg_splat]` attribute cannot be used on trait impl blocks --> $DIR/splat-non-fn-arg.rs:33:1 | -LL | #[splat] - | ^^^^^^^^ +LL | #[arg_splat] + | ^^^^^^^^^^^^ | - = help: `#[splat]` can only be applied to function params + = help: `#[arg_splat]` can only be applied to function params -error: `#[splat]` attribute cannot be used on foreign modules +error: `#[arg_splat]` attribute cannot be used on foreign modules --> $DIR/splat-non-fn-arg.rs:40:1 | -LL | #[splat] - | ^^^^^^^^ +LL | #[arg_splat] + | ^^^^^^^^^^^^ | - = help: `#[splat]` can only be applied to function params + = help: `#[arg_splat]` can only be applied to function params -error: `#[splat]` attribute cannot be used on foreign functions +error: `#[arg_splat]` attribute cannot be used on foreign functions --> $DIR/splat-non-fn-arg.rs:46:5 | -LL | #[splat] - | ^^^^^^^^ +LL | #[arg_splat] + | ^^^^^^^^^^^^ | - = help: `#[splat]` can only be applied to function params + = help: `#[arg_splat]` can only be applied to function params -error: `#[splat]` attribute cannot be used on modules +error: `#[arg_splat]` attribute cannot be used on modules --> $DIR/splat-non-fn-arg.rs:50:1 | -LL | #[splat] - | ^^^^^^^^ +LL | #[arg_splat] + | ^^^^^^^^^^^^ | - = help: `#[splat]` can only be applied to function params + = help: `#[arg_splat]` can only be applied to function params -error: `#[splat]` attribute cannot be used on use statements +error: `#[arg_splat]` attribute cannot be used on use statements --> $DIR/splat-non-fn-arg.rs:53:1 | -LL | #[splat] - | ^^^^^^^^ +LL | #[arg_splat] + | ^^^^^^^^^^^^ | - = help: `#[splat]` can only be applied to function params + = help: `#[arg_splat]` can only be applied to function params -error: `#[splat]` attribute cannot be used on structs +error: `#[arg_splat]` attribute cannot be used on structs --> $DIR/splat-non-fn-arg.rs:56:1 | -LL | #[splat] - | ^^^^^^^^ +LL | #[arg_splat] + | ^^^^^^^^^^^^ | - = help: `#[splat]` can only be applied to function params + = help: `#[arg_splat]` can only be applied to function params error: aborting due to 11 previous errors diff --git a/tests/ui/splat/splat-non-tuple.rs b/tests/ui/splat/splat-non-tuple.rs index 35841a770b226..e3d0ece08eb77 100644 --- a/tests/ui/splat/splat-non-tuple.rs +++ b/tests/ui/splat/splat-non-tuple.rs @@ -1,33 +1,33 @@ -//! Test that using `#[splat]` on non-tuple function arguments is an error. +//! Test that using `#[arg_splat]` on non-tuple function arguments is an error. #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] #![expect(unused)] -fn primitive_arg(#[splat] x: u32) {} //~ ERROR cannot use splat attribute; the splatted argument type must be a tuple or unit, not a u32 +fn primitive_arg(#[arg_splat] x: u32) {} //~ ERROR cannot use splat attribute; the splatted argument type must be a tuple or unit, not a u32 enum NotATuple { A(u32), B(i8), } -fn enum_arg(#[splat] y: NotATuple) {} //~ ERROR cannot use splat attribute; the splatted argument type must be a tuple or unit, not a NotATuple +fn enum_arg(#[arg_splat] y: NotATuple) {} //~ ERROR cannot use splat attribute; the splatted argument type must be a tuple or unit, not a NotATuple trait FooTrait { - fn tuple_1(#[splat] _: (u32,)); //~ NOTE type in trait + fn tuple_1(#[arg_splat] _: (u32,)); //~ NOTE type in trait // Ambiguous case, self could be a tuple or a non-tuple - fn tuple_4(#[splat] self, _: (u32, i8, (), f32)); + fn tuple_4(#[arg_splat] self, _: (u32, i8, (), f32)); } struct Foo; -fn struct_arg(#[splat] z: Foo) {} //~ ERROR cannot use splat attribute; the splatted argument type must be a tuple or unit, not a Foo +fn struct_arg(#[arg_splat] z: Foo) {} //~ ERROR cannot use splat attribute; the splatted argument type must be a tuple or unit, not a Foo impl Foo { fn tuple_2_self( // FIXME(splat): ERROR cannot use splat attribute; the splatted argument type must be a... - #[splat] self, + #[arg_splat] self, (a, b): (u32, i8), ) -> u32 { a @@ -38,12 +38,12 @@ impl FooTrait for Foo { fn tuple_1(_: (u32,)) {} //~^ ERROR method `tuple_1` has an incompatible type for trait //~| NOTE expected fn with arg 0 splatted, found fn with no splatted arg - //~| NOTE expected signature `fn(#[splat] (_,))` + //~| NOTE expected signature `fn(#[arg_splat] (_,))` //~| NOTE found signature `fn((_,))` fn tuple_4( // FIXME(splat): ERROR cannot use splat attribute; the splatted argument type must be a... - #[splat] self, + #[arg_splat] self, _: (u32, i8, (), f32), ) { } @@ -51,11 +51,11 @@ impl FooTrait for Foo { struct TupleStruct(u32, i8); -fn tuple_struct_arg(#[splat] z: TupleStruct) {} //~ ERROR cannot use splat attribute; the splatted argument type must be a tuple or unit, not a TupleStruct +fn tuple_struct_arg(#[arg_splat] z: TupleStruct) {} //~ ERROR cannot use splat attribute; the splatted argument type must be a tuple or unit, not a TupleStruct impl TupleStruct { fn tuple_2( - #[splat] self, // FIXME(splat): ERROR `#[splat]` attribute must be used on a tuple + #[arg_splat] self, // FIXME(splat): ERROR `#[arg_splat]` attribute must be used on a tuple (a, b): (f32, f64), ) -> f32 { a @@ -63,10 +63,10 @@ impl TupleStruct { } impl FooTrait for TupleStruct { - fn tuple_1(#[splat] _: (u32,)) {} + fn tuple_1(#[arg_splat] _: (u32,)) {} fn tuple_4( - #[splat] self, // FIXME(splat): ERROR `#[splat]` attribute must be used on a tuple + #[arg_splat] self, // FIXME(splat): ERROR `#[arg_splat]` attribute must be used on a tuple _: (u32, i8, (), f32), ) { } diff --git a/tests/ui/splat/splat-non-tuple.stderr b/tests/ui/splat/splat-non-tuple.stderr index 64f7148d8dbd2..916cdb8dd0321 100644 --- a/tests/ui/splat/splat-non-tuple.stderr +++ b/tests/ui/splat/splat-non-tuple.stderr @@ -7,43 +7,43 @@ LL | fn tuple_1(_: (u32,)) {} note: type in trait --> $DIR/splat-non-tuple.rs:17:5 | -LL | fn tuple_1(#[splat] _: (u32,)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: expected signature `fn(#[splat] (_,))` +LL | fn tuple_1(#[arg_splat] _: (u32,)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: expected signature `fn(#[arg_splat] (_,))` found signature `fn((_,))` error[E0277]: cannot use splat attribute; the splatted argument type must be a tuple or unit, not a u32 (u32) - --> $DIR/splat-non-tuple.rs:7:30 + --> $DIR/splat-non-tuple.rs:7:34 | -LL | fn primitive_arg(#[splat] x: u32) {} - | ^^^ +LL | fn primitive_arg(#[arg_splat] x: u32) {} + | ^^^ ... LL | primitive_arg(1u32); | ^^^^^^^^^^^^^^^^^^^ error[E0277]: cannot use splat attribute; the splatted argument type must be a tuple or unit, not a NotATuple (NotATuple) - --> $DIR/splat-non-tuple.rs:14:25 + --> $DIR/splat-non-tuple.rs:14:29 | -LL | fn enum_arg(#[splat] y: NotATuple) {} - | ^^^^^^^^^ +LL | fn enum_arg(#[arg_splat] y: NotATuple) {} + | ^^^^^^^^^ ... LL | enum_arg(NotATuple::A(1u32)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: cannot use splat attribute; the splatted argument type must be a tuple or unit, not a Foo (Foo) - --> $DIR/splat-non-tuple.rs:25:27 + --> $DIR/splat-non-tuple.rs:25:31 | -LL | fn struct_arg(#[splat] z: Foo) {} - | ^^^ +LL | fn struct_arg(#[arg_splat] z: Foo) {} + | ^^^ ... LL | struct_arg(foo); | ^^^^^^^^^^^^^^^ error[E0277]: cannot use splat attribute; the splatted argument type must be a tuple or unit, not a TupleStruct (TupleStruct) - --> $DIR/splat-non-tuple.rs:54:33 + --> $DIR/splat-non-tuple.rs:54:37 | -LL | fn tuple_struct_arg(#[splat] z: TupleStruct) {} - | ^^^^^^^^^^^ +LL | fn tuple_struct_arg(#[arg_splat] z: TupleStruct) {} + | ^^^^^^^^^^^ ... LL | tuple_struct_arg(tuple_struct); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/splat/splat-overload-at-home-fail.rs b/tests/ui/splat/splat-overload-at-home-fail.rs index 8e6a375e0eb96..078ec486211e1 100644 --- a/tests/ui/splat/splat-overload-at-home-fail.rs +++ b/tests/ui/splat/splat-overload-at-home-fail.rs @@ -1,7 +1,7 @@ -//! Test error cases for `#[splat]` "overloading at home" example code. +//! Test error cases for `#[arg_splat]` "overloading at home" example code. //! Splatted calls that don't match any registered MethodArgs impl should fail. #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] #![feature(tuple_trait)] struct Foo; @@ -23,7 +23,7 @@ impl MethodArgs for (i32, String) { } impl Foo { - fn method(&self, #[splat] args: T) { + fn method(&self, #[arg_splat] args: T) { args.call_method(self) } } diff --git a/tests/ui/splat/splat-overload-at-home-fail.stderr b/tests/ui/splat/splat-overload-at-home-fail.stderr index fcedccf28c359..e26e8a9a6956d 100644 --- a/tests/ui/splat/splat-overload-at-home-fail.stderr +++ b/tests/ui/splat/splat-overload-at-home-fail.stderr @@ -9,8 +9,8 @@ LL | foo.method(42f32); note: method defined here --> $DIR/splat-overload-at-home-fail.rs:26:8 | -LL | fn method(&self, #[splat] args: T) { - | ^^^^^^ ---------------- +LL | fn method(&self, #[arg_splat] args: T) { + | ^^^^^^ -------------------- help: change the type of the numeric literal from `f32` to `i32` | LL - foo.method(42f32); @@ -28,7 +28,7 @@ LL | foo.method(42i32, 42i32); note: method defined here --> $DIR/splat-overload-at-home-fail.rs:26:8 | -LL | fn method(&self, #[splat] args: T) { +LL | fn method(&self, #[arg_splat] args: T) { | ^^^^^^ help: try using a conversion method | diff --git a/tests/ui/splat/splat-overload-at-home.rs b/tests/ui/splat/splat-overload-at-home.rs index a470a296ca380..618173f2562f2 100644 --- a/tests/ui/splat/splat-overload-at-home.rs +++ b/tests/ui/splat/splat-overload-at-home.rs @@ -1,10 +1,10 @@ //@ run-pass // ignore-tidy-file-linelength -//! Test using `#[splat]` on some "overloading at home" example code. +//! Test using `#[arg_splat]` on some "overloading at home" example code. //! #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] #![feature(tuple_trait)] struct Foo; @@ -23,7 +23,7 @@ impl MethodArgs for (i32, String) { } impl Foo { - fn method(&self, #[splat] args: T) { + fn method(&self, #[arg_splat] args: T) { args.call_method(self) } } diff --git a/tests/ui/splat/splat-rust-call-fn-trait-issue-158800.rs b/tests/ui/splat/splat-rust-call-fn-trait-issue-158800.rs index dc207530cba49..c2b750b8690b4 100644 --- a/tests/ui/splat/splat-rust-call-fn-trait-issue-158800.rs +++ b/tests/ui/splat/splat-rust-call-fn-trait-issue-158800.rs @@ -1,14 +1,14 @@ -//! Regression test for `#[splat] ()` in a rust-call Fn* trait method not ICEing in WF +//! Regression test for `#[arg_splat] ()` in a rust-call Fn* trait method not ICEing in WF //! checking. -#![feature(splat)] +#![feature(arg_splat)] #![feature(unboxed_closures)] #![expect(incomplete_features)] impl dyn FnOnce(T) -> () { //~^ ERROR cannot define inherent `impl` for a type outside of the crate - extern "rust-call" fn call_once(#[splat] _: ()) {} - //~^ ERROR `#[splat]` is not allowed in the arguments of functions with the `rust-call` ABI + extern "rust-call" fn call_once(#[arg_splat] _: ()) {} + //~^ ERROR `#[arg_splat]` is not allowed in the arguments of functions with the `rust-call` ABI } fn main() {} diff --git a/tests/ui/splat/splat-rust-call-fn-trait-issue-158800.stderr b/tests/ui/splat/splat-rust-call-fn-trait-issue-158800.stderr index e20b21863fd90..5d7dbe1520150 100644 --- a/tests/ui/splat/splat-rust-call-fn-trait-issue-158800.stderr +++ b/tests/ui/splat/splat-rust-call-fn-trait-issue-158800.stderr @@ -1,10 +1,10 @@ -error: `#[splat]` is not allowed in the arguments of functions with the `rust-call` ABI +error: `#[arg_splat]` is not allowed in the arguments of functions with the `rust-call` ABI --> $DIR/splat-rust-call-fn-trait-issue-158800.rs:10:5 | -LL | extern "rust-call" fn call_once(#[splat] _: ()) {} - | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^ +LL | extern "rust-call" fn call_once(#[arg_splat] _: ()) {} + | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ | - = help: remove `#[splat]` or change the ABI + = help: remove `#[arg_splat]` or change the ABI error[E0116]: cannot define inherent `impl` for a type outside of the crate where the type is defined --> $DIR/splat-rust-call-fn-trait-issue-158800.rs:8:1 diff --git a/tests/ui/splat/splat-rust-call-fn-trait-self-issue-158800.rs b/tests/ui/splat/splat-rust-call-fn-trait-self-issue-158800.rs index c4c66c4ace718..d2baf923a5d15 100644 --- a/tests/ui/splat/splat-rust-call-fn-trait-self-issue-158800.rs +++ b/tests/ui/splat/splat-rust-call-fn-trait-self-issue-158800.rs @@ -1,14 +1,14 @@ -//! Regression test for `#[splat] self` in a rust-call Fn* trait method not ICEing in WF +//! Regression test for `#[arg_splat] self` in a rust-call Fn* trait method not ICEing in WF //! checking. -#![feature(splat)] +#![feature(arg_splat)] #![feature(unboxed_closures)] #![expect(incomplete_features)] impl dyn FnOnce(T) -> () { //~^ ERROR cannot define inherent `impl` for a type outside of the crate - extern "rust-call" fn call_once(#[splat] self) {} - //~^ ERROR `#[splat]` is not allowed in the arguments of functions with the `rust-call` ABI + extern "rust-call" fn call_once(#[arg_splat] self) {} + //~^ ERROR `#[arg_splat]` is not allowed in the arguments of functions with the `rust-call` ABI //~| ERROR functions with the "rust-call" ABI must take a single non-self tuple argument //~| ERROR the size for values of type `(dyn FnOnce(T) + 'static)` cannot be known } diff --git a/tests/ui/splat/splat-rust-call-fn-trait-self-issue-158800.stderr b/tests/ui/splat/splat-rust-call-fn-trait-self-issue-158800.stderr index 41f1f211e3125..d4a8bfbf39e64 100644 --- a/tests/ui/splat/splat-rust-call-fn-trait-self-issue-158800.stderr +++ b/tests/ui/splat/splat-rust-call-fn-trait-self-issue-158800.stderr @@ -1,16 +1,16 @@ -error: `#[splat]` is not allowed in the arguments of functions with the `rust-call` ABI +error: `#[arg_splat]` is not allowed in the arguments of functions with the `rust-call` ABI --> $DIR/splat-rust-call-fn-trait-self-issue-158800.rs:10:5 | -LL | extern "rust-call" fn call_once(#[splat] self) {} - | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^ +LL | extern "rust-call" fn call_once(#[arg_splat] self) {} + | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ | - = help: remove `#[splat]` or change the ABI + = help: remove `#[arg_splat]` or change the ABI error: functions with the "rust-call" ABI must take a single non-self tuple argument - --> $DIR/splat-rust-call-fn-trait-self-issue-158800.rs:10:46 + --> $DIR/splat-rust-call-fn-trait-self-issue-158800.rs:10:50 | -LL | extern "rust-call" fn call_once(#[splat] self) {} - | ^^^^ +LL | extern "rust-call" fn call_once(#[arg_splat] self) {} + | ^^^^ error[E0116]: cannot define inherent `impl` for a type outside of the crate where the type is defined --> $DIR/splat-rust-call-fn-trait-self-issue-158800.rs:8:1 @@ -22,17 +22,17 @@ LL | impl dyn FnOnce(T) -> () { = note: for more details about the orphan rules, see error[E0277]: the size for values of type `(dyn FnOnce(T) + 'static)` cannot be known at compilation time - --> $DIR/splat-rust-call-fn-trait-self-issue-158800.rs:10:46 + --> $DIR/splat-rust-call-fn-trait-self-issue-158800.rs:10:50 | -LL | extern "rust-call" fn call_once(#[splat] self) {} - | ^^^^ doesn't have a size known at compile-time +LL | extern "rust-call" fn call_once(#[arg_splat] self) {} + | ^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `(dyn FnOnce(T) + 'static)` = help: unsized fn params are gated as an unstable feature help: function arguments must have a statically known size, borrowed types always have a known size | -LL | extern "rust-call" fn call_once(#[splat] &self) {} - | + +LL | extern "rust-call" fn call_once(#[arg_splat] &self) {} + | + error: aborting due to 4 previous errors diff --git a/tests/ui/splat/splat-rust-call-trait-issue-158800.rs b/tests/ui/splat/splat-rust-call-trait-issue-158800.rs index 188575e97793f..3373ff5423652 100644 --- a/tests/ui/splat/splat-rust-call-trait-issue-158800.rs +++ b/tests/ui/splat/splat-rust-call-trait-issue-158800.rs @@ -1,18 +1,18 @@ -//! Regression test for `#[splat] ()` in a rust-call trait method not ICEing in WF +//! Regression test for `#[arg_splat] ()` in a rust-call trait method not ICEing in WF //! checking. -#![feature(splat)] +#![feature(arg_splat)] #![feature(unboxed_closures)] #![expect(incomplete_features)] trait Trait { - extern "rust-call" fn f(#[splat] _: ()) where Self: Sized; - //~^ ERROR `#[splat]` is not allowed in the arguments of functions with the `rust-call` ABI + extern "rust-call" fn f(#[arg_splat] _: ()) where Self: Sized; + //~^ ERROR `#[arg_splat]` is not allowed in the arguments of functions with the `rust-call` ABI } impl dyn Trait { - extern "rust-call" fn f(#[splat] _: ()) where Self: Sized {} - //~^ ERROR `#[splat]` is not allowed in the arguments of functions with the `rust-call` ABI + extern "rust-call" fn f(#[arg_splat] _: ()) where Self: Sized {} + //~^ ERROR `#[arg_splat]` is not allowed in the arguments of functions with the `rust-call` ABI //~| ERROR the size for values of type `(dyn Trait + 'static)` cannot be known at compilation time } diff --git a/tests/ui/splat/splat-rust-call-trait-issue-158800.stderr b/tests/ui/splat/splat-rust-call-trait-issue-158800.stderr index 4614be97ea0b4..fbc0c888772e0 100644 --- a/tests/ui/splat/splat-rust-call-trait-issue-158800.stderr +++ b/tests/ui/splat/splat-rust-call-trait-issue-158800.stderr @@ -1,24 +1,24 @@ -error: `#[splat]` is not allowed in the arguments of functions with the `rust-call` ABI +error: `#[arg_splat]` is not allowed in the arguments of functions with the `rust-call` ABI --> $DIR/splat-rust-call-trait-issue-158800.rs:9:5 | -LL | extern "rust-call" fn f(#[splat] _: ()) where Self: Sized; - | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^ +LL | extern "rust-call" fn f(#[arg_splat] _: ()) where Self: Sized; + | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ | - = help: remove `#[splat]` or change the ABI + = help: remove `#[arg_splat]` or change the ABI -error: `#[splat]` is not allowed in the arguments of functions with the `rust-call` ABI +error: `#[arg_splat]` is not allowed in the arguments of functions with the `rust-call` ABI --> $DIR/splat-rust-call-trait-issue-158800.rs:14:5 | -LL | extern "rust-call" fn f(#[splat] _: ()) where Self: Sized {} - | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^ +LL | extern "rust-call" fn f(#[arg_splat] _: ()) where Self: Sized {} + | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ | - = help: remove `#[splat]` or change the ABI + = help: remove `#[arg_splat]` or change the ABI error[E0277]: the size for values of type `(dyn Trait + 'static)` cannot be known at compilation time - --> $DIR/splat-rust-call-trait-issue-158800.rs:14:51 + --> $DIR/splat-rust-call-trait-issue-158800.rs:14:55 | -LL | extern "rust-call" fn f(#[splat] _: ()) where Self: Sized {} - | ^^^^^^^^^^^ doesn't have a size known at compile-time +LL | extern "rust-call" fn f(#[arg_splat] _: ()) where Self: Sized {} + | ^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `(dyn Trait + 'static)` help: add `#![feature(trivial_bounds)]` to the crate attributes to enable diff --git a/tests/ui/splat/splat-rust-call-type-issue-158800.rs b/tests/ui/splat/splat-rust-call-type-issue-158800.rs index 286ee7410117b..a21c977f195c1 100644 --- a/tests/ui/splat/splat-rust-call-type-issue-158800.rs +++ b/tests/ui/splat/splat-rust-call-type-issue-158800.rs @@ -1,25 +1,25 @@ -//! Regression test for `#[splat] ())` in a rust-call type method not ICEing in WF +//! Regression test for `#[arg_splat] ())` in a rust-call type method not ICEing in WF //! checking. -#![feature(splat)] +#![feature(arg_splat)] #![feature(unboxed_closures)] #![expect(incomplete_features)] struct Type; trait Trait { - extern "rust-call" fn f(#[splat] _: ()); - //~^ ERROR `#[splat]` is not allowed in the arguments of functions with the `rust-call` ABI + extern "rust-call" fn f(#[arg_splat] _: ()); + //~^ ERROR `#[arg_splat]` is not allowed in the arguments of functions with the `rust-call` ABI } impl Type { - extern "rust-call" fn f2(#[splat] _: ()) {} - //~^ ERROR `#[splat]` is not allowed in the arguments of functions with the `rust-call` ABI + extern "rust-call" fn f2(#[arg_splat] _: ()) {} + //~^ ERROR `#[arg_splat]` is not allowed in the arguments of functions with the `rust-call` ABI } impl Trait for Type { - extern "rust-call" fn f(#[splat] _: ()) {} - //~^ ERROR `#[splat]` is not allowed in the arguments of functions with the `rust-call` ABI + extern "rust-call" fn f(#[arg_splat] _: ()) {} + //~^ ERROR `#[arg_splat]` is not allowed in the arguments of functions with the `rust-call` ABI } fn main() {} diff --git a/tests/ui/splat/splat-rust-call-type-issue-158800.stderr b/tests/ui/splat/splat-rust-call-type-issue-158800.stderr index df0d4f7a3c7b5..2f445c42d47f7 100644 --- a/tests/ui/splat/splat-rust-call-type-issue-158800.stderr +++ b/tests/ui/splat/splat-rust-call-type-issue-158800.stderr @@ -1,26 +1,26 @@ -error: `#[splat]` is not allowed in the arguments of functions with the `rust-call` ABI +error: `#[arg_splat]` is not allowed in the arguments of functions with the `rust-call` ABI --> $DIR/splat-rust-call-type-issue-158800.rs:11:5 | -LL | extern "rust-call" fn f(#[splat] _: ()); - | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^ +LL | extern "rust-call" fn f(#[arg_splat] _: ()); + | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ | - = help: remove `#[splat]` or change the ABI + = help: remove `#[arg_splat]` or change the ABI -error: `#[splat]` is not allowed in the arguments of functions with the `rust-call` ABI +error: `#[arg_splat]` is not allowed in the arguments of functions with the `rust-call` ABI --> $DIR/splat-rust-call-type-issue-158800.rs:16:5 | -LL | extern "rust-call" fn f2(#[splat] _: ()) {} - | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^ +LL | extern "rust-call" fn f2(#[arg_splat] _: ()) {} + | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ | - = help: remove `#[splat]` or change the ABI + = help: remove `#[arg_splat]` or change the ABI -error: `#[splat]` is not allowed in the arguments of functions with the `rust-call` ABI +error: `#[arg_splat]` is not allowed in the arguments of functions with the `rust-call` ABI --> $DIR/splat-rust-call-type-issue-158800.rs:21:5 | -LL | extern "rust-call" fn f(#[splat] _: ()) {} - | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^ +LL | extern "rust-call" fn f(#[arg_splat] _: ()) {} + | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ | - = help: remove `#[splat]` or change the ABI + = help: remove `#[arg_splat]` or change the ABI error: aborting due to 3 previous errors diff --git a/tests/ui/splat/splat-self.rs b/tests/ui/splat/splat-self.rs index b826a5b30b9bc..75bbe35e83f02 100644 --- a/tests/ui/splat/splat-self.rs +++ b/tests/ui/splat/splat-self.rs @@ -1,16 +1,16 @@ //@ run-pass //@ check-run-results -//! Test using `#[splat]` on self arguments of trait methods. +//! Test using `#[arg_splat]` on self arguments of trait methods. -#![feature(splat)] +#![feature(arg_splat)] #![expect(incomplete_features)] trait Trait { - fn method(#[splat] self: Self); + fn method(#[arg_splat] self: Self); } impl Trait for (i32, i64) { - fn method(#[splat] self: Self) { + fn method(#[arg_splat] self: Self) { println!("{self:?}"); } } diff --git a/tests/ui/splat/splat-trait-tuple.rs b/tests/ui/splat/splat-trait-tuple.rs index a5b74a40cffd9..82c231b46c23a 100644 --- a/tests/ui/splat/splat-trait-tuple.rs +++ b/tests/ui/splat/splat-trait-tuple.rs @@ -1,31 +1,31 @@ //@ run-pass -//! Test using `#[splat]` on trait assoc function/method tuple arguments. +//! Test using `#[arg_splat]` on trait assoc function/method tuple arguments. #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] trait FooTrait { - fn tuple_1_trait(#[splat] _: (u32,)); + fn tuple_1_trait(#[arg_splat] _: (u32,)); - fn tuple_2_trait(&self, #[splat] _: (u32, f32)); + fn tuple_2_trait(&self, #[arg_splat] _: (u32, f32)); } struct Foo; impl FooTrait for Foo { // Currently, splat attributes on impls must match traits. This provides better UX. - fn tuple_1_trait(#[splat] _: (u32,)) {} + fn tuple_1_trait(#[arg_splat] _: (u32,)) {} - fn tuple_2_trait(&self, #[splat] _: (u32, f32)) {} + fn tuple_2_trait(&self, #[arg_splat] _: (u32, f32)) {} } #[expect(dead_code)] struct TupleStruct(u32, i8); impl FooTrait for TupleStruct { - fn tuple_1_trait(#[splat] _: (u32,)) {} + fn tuple_1_trait(#[arg_splat] _: (u32,)) {} - fn tuple_2_trait(&self, #[splat] _: (u32, f32)) {} + fn tuple_2_trait(&self, #[arg_splat] _: (u32, f32)) {} } fn main() { diff --git a/tests/ui/splat/splat-unsafe-fn-tuple-fail.rs b/tests/ui/splat/splat-unsafe-fn-tuple-fail.rs index 473aff7891636..02ded18ab732d 100644 --- a/tests/ui/splat/splat-unsafe-fn-tuple-fail.rs +++ b/tests/ui/splat/splat-unsafe-fn-tuple-fail.rs @@ -1,13 +1,13 @@ -//! Test that using `#[splat]` incorrectly on unsafe functions gives errors. +//! Test that using `#[arg_splat]` incorrectly on unsafe functions gives errors. #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] -unsafe fn unsafe_wrong_type(#[splat] _x: u32) {} +unsafe fn unsafe_wrong_type(#[arg_splat] _x: u32) {} //~^ ERROR cannot use splat attribute; the splatted argument type must be a tuple or unit, not a u32 -unsafe fn unsafe_multi_splat(#[splat] (_a, _b): (u32, i8), #[splat] (_c, _d): (u32, i8)) {} -//~^ ERROR multiple `#[splat]`s are not allowed in the same function argument list +unsafe fn unsafe_multi_splat(#[arg_splat] (_a, _b): (u32, i8), #[arg_splat] (_c, _d): (u32, i8)) {} +//~^ ERROR multiple `#[arg_splat]`s are not allowed in the same function argument list fn main() { unsafe { diff --git a/tests/ui/splat/splat-unsafe-fn-tuple-fail.stderr b/tests/ui/splat/splat-unsafe-fn-tuple-fail.stderr index 7ad15f0f960e2..dc995087ad4f8 100644 --- a/tests/ui/splat/splat-unsafe-fn-tuple-fail.stderr +++ b/tests/ui/splat/splat-unsafe-fn-tuple-fail.stderr @@ -1,16 +1,16 @@ -error: multiple `#[splat]`s are not allowed in the same function argument list +error: multiple `#[arg_splat]`s are not allowed in the same function argument list --> $DIR/splat-unsafe-fn-tuple-fail.rs:9:30 | -LL | unsafe fn unsafe_multi_splat(#[splat] (_a, _b): (u32, i8), #[splat] (_c, _d): (u32, i8)) {} - | ^^^^^^^^ ^^^^^^^^ +LL | unsafe fn unsafe_multi_splat(#[arg_splat] (_a, _b): (u32, i8), #[arg_splat] (_c, _d): (u32, i8)) {} + | ^^^^^^^^^^^^ ^^^^^^^^^^^^ | - = help: remove `#[splat]` from all but one argument + = help: remove `#[arg_splat]` from all but one argument error[E0277]: cannot use splat attribute; the splatted argument type must be a tuple or unit, not a u32 (u32) - --> $DIR/splat-unsafe-fn-tuple-fail.rs:6:42 + --> $DIR/splat-unsafe-fn-tuple-fail.rs:6:46 | -LL | unsafe fn unsafe_wrong_type(#[splat] _x: u32) {} - | ^^^ +LL | unsafe fn unsafe_wrong_type(#[arg_splat] _x: u32) {} + | ^^^ ... LL | unsafe_wrong_type(1u32); | ^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/splat/splat-unsafe-fn-tuple.rs b/tests/ui/splat/splat-unsafe-fn-tuple.rs index 0b9b3510ad50b..04d2f8633c847 100644 --- a/tests/ui/splat/splat-unsafe-fn-tuple.rs +++ b/tests/ui/splat/splat-unsafe-fn-tuple.rs @@ -1,12 +1,12 @@ //@ run-pass -//! Test using `#[splat]` on tuple arguments of unsafe functions. +//! Test using `#[arg_splat]` on tuple arguments of unsafe functions. #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] -unsafe fn unsafe_tuple_args(#[splat] (_a, _b): (u32, i8)) {} +unsafe fn unsafe_tuple_args(#[arg_splat] (_a, _b): (u32, i8)) {} -unsafe fn unsafe_splat_non_terminal_arg(#[splat] (_a, _b): (u32, i8), _c: f64) {} +unsafe fn unsafe_splat_non_terminal_arg(#[arg_splat] (_a, _b): (u32, i8), _c: f64) {} fn main() { unsafe { diff --git a/tests/ui/splat/splat-where-clause.rs b/tests/ui/splat/splat-where-clause.rs index 42a23fe67b216..8c3dababd040a 100644 --- a/tests/ui/splat/splat-where-clause.rs +++ b/tests/ui/splat/splat-where-clause.rs @@ -1,17 +1,17 @@ //@ run-pass -//! Test using `#[splat]` on tuple arguments with where clause bounds. +//! Test using `#[arg_splat]` on tuple arguments with where clause bounds. #![allow(incomplete_features)] -#![feature(splat)] +#![feature(arg_splat)] #![feature(tuple_trait)] -fn where_splat(#[splat] _t: T) where T: std::marker::Tuple {} +fn where_splat(#[arg_splat] _t: T) where T: std::marker::Tuple {} -fn where_splat_with_extra(#[splat] _t: T, _extra: u32) where T: std::marker::Tuple {} +fn where_splat_with_extra(#[arg_splat] _t: T, _extra: u32) where T: std::marker::Tuple {} -fn impl_tuple_splat(#[splat] _t: impl std::marker::Tuple) {} +fn impl_tuple_splat(#[arg_splat] _t: impl std::marker::Tuple) {} -fn impl_tuple_splat_with_extra(#[splat] _t: impl std::marker::Tuple, _extra: u32) {} +fn impl_tuple_splat_with_extra(#[arg_splat] _t: impl std::marker::Tuple, _extra: u32) {} fn main() { // empty tuple