blob: 7ebc82aaeae0d2073c1ba4720ea957c69bddaec9 [file] [edit]
//@ run-pass
//! Test using `#[rustc_splat]` on method tuple arguments (with receivers).
#![allow(incomplete_features)]
#![feature(splat)]
struct Foo;
impl Foo {
fn tuple_2(&self, #[rustc_splat] (a, _b): (u32, i8)) -> u32 {
a
}
fn tuple_4(&self, #[rustc_splat] (a, _b, _c, _d): (u32, i8, (), f32)) -> u32 {
a
}
}
#[expect(dead_code)]
struct TupleStruct(u32, i8);
impl TupleStruct {
fn tuple_2(&self, #[rustc_splat] (a, _b): (u32, i8)) -> u32 {
a
}
}
fn main() {
let foo = Foo;
foo.tuple_2(1u32, 2i8);
foo.tuple_4(1u32, 2i8, (), 3f32);
let tuple_struct = TupleStruct(1u32, 2i8);
tuple_struct.tuple_2(1u32, 2i8);
}