summaryrefslogtreecommitdiffstats
path: root/tests/ui/trailing-comma.rs
blob: 90adba99e542bc8abdba5aa5758b0b5d4bdad5f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// run-pass
// pretty-expanded FIXME #23616

fn f<T,>(_: T,) {}

struct Foo<T,>(#[allow(unused_tuple_struct_fields)] T);

struct Bar;

impl Bar {
    fn f(_: isize,) {}
    fn g(self, _: isize,) {}
    fn h(self,) {}
}

enum Baz {
    Qux(#[allow(unused_tuple_struct_fields)] isize,),
}

#[allow(unused,)]
pub fn main() {
    f::<isize,>(0,);
    let (_, _,) = (1, 1,);
    let [_, _,] = [1, 1,];
    let [_, _, .., _,] = [1, 1, 1, 1,];
    let [_, _, _, ..,] = [1, 1, 1, 1,];

    let x: Foo<isize,> = Foo::<isize,>(1);

    Bar::f(0,);
    Bar.g(0,);
    Bar.h();

    let x = Baz::Qux(1,);
}