]> git.lizzy.rs Git - rust.git/blob - src/test/ui/trailing-comma.rs
Rollup merge of #97739 - a2aaron:let_underscore, r=estebank
[rust.git] / src / test / ui / trailing-comma.rs
1 // run-pass
2 // pretty-expanded FIXME #23616
3
4 fn f<T,>(_: T,) {}
5
6 struct Foo<T,>(#[allow(unused_tuple_struct_fields)] T);
7
8 struct Bar;
9
10 impl Bar {
11     fn f(_: isize,) {}
12     fn g(self, _: isize,) {}
13     fn h(self,) {}
14 }
15
16 enum Baz {
17     Qux(#[allow(unused_tuple_struct_fields)] isize,),
18 }
19
20 #[allow(unused,)]
21 pub fn main() {
22     f::<isize,>(0,);
23     let (_, _,) = (1, 1,);
24     let [_, _,] = [1, 1,];
25     let [_, _, .., _,] = [1, 1, 1, 1,];
26     let [_, _, _, ..,] = [1, 1, 1, 1,];
27
28     let x: Foo<isize,> = Foo::<isize,>(1);
29
30     Bar::f(0,);
31     Bar.g(0,);
32     Bar.h();
33
34     let x = Baz::Qux(1,);
35 }