about summary refs log tree commit diff
path: root/tests/ui/parser/syntactic-trailing-commas.rs
diff options
context:
space:
mode:
authorKivooeo <Kivooeo123@gmail.com>2025-07-01 20:20:14 +0500
committerKivooeo <Kivooeo123@gmail.com>2025-07-13 00:03:31 +0500
commit47b8a32ca311e2c441f4e7d747bfd75f0045baa1 (patch)
tree081904d1f6314f1ba20a7aabfe52a2a02dc95a16 /tests/ui/parser/syntactic-trailing-commas.rs
parentbfc046a4b8d6b57db02540182466e989a9b0fb40 (diff)
downloadrust-47b8a32ca311e2c441f4e7d747bfd75f0045baa1.tar.gz
rust-47b8a32ca311e2c441f4e7d747bfd75f0045baa1.zip
moved tests
Diffstat (limited to 'tests/ui/parser/syntactic-trailing-commas.rs')
-rw-r--r--tests/ui/parser/syntactic-trailing-commas.rs34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/ui/parser/syntactic-trailing-commas.rs b/tests/ui/parser/syntactic-trailing-commas.rs
new file mode 100644
index 00000000000..53b76fb6037
--- /dev/null
+++ b/tests/ui/parser/syntactic-trailing-commas.rs
@@ -0,0 +1,34 @@
+//@ run-pass
+
+fn f<T,>(_: T,) {}
+
+struct Foo<T,>(#[allow(dead_code)] T);
+
+struct Bar;
+
+impl Bar {
+    fn f(_: isize,) {}
+    fn g(self, _: isize,) {}
+    fn h(self,) {}
+}
+
+enum Baz {
+    Qux(#[allow(dead_code)] 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,);
+}