about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorP1start <rewi-github@whanau.org>2014-08-21 16:37:15 +1200
committerP1start <rewi-github@whanau.org>2014-08-23 07:23:51 +1200
commitfde41a3f7026023ef968a41bcb256dc96a384e09 (patch)
tree623ccb30502275e76b504929cb26139cb72c1f2d /src/test
parenteaf810a219b136fff67e75840ad3c5efde9ae1e5 (diff)
downloadrust-fde41a3f7026023ef968a41bcb256dc96a384e09.tar.gz
rust-fde41a3f7026023ef968a41bcb256dc96a384e09.zip
Add support for trailing commas in more places
This lets the parser understand trailing commas in method calls, method
definitions, enum variants, and type parameters.

Closes #14240.
Closes #15887.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/trailing-comma.rs26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/test/run-pass/trailing-comma.rs b/src/test/run-pass/trailing-comma.rs
index 8d580729da9..394ff831d9b 100644
--- a/src/test/run-pass/trailing-comma.rs
+++ b/src/test/run-pass/trailing-comma.rs
@@ -8,9 +8,31 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-fn f(_: int,) {}
+fn f<T,>(_: T,) {}
+
+struct Foo<T,>;
+
+struct Bar;
+
+impl Bar {
+    fn f(_: int,) {}
+    fn g(self, _: int,) {}
+    fn h(self,) {}
+}
+
+enum Baz {
+    Qux(int,),
+}
 
 pub fn main() {
-    f(0i,);
+    f::<int,>(0i,);
     let (_, _,) = (1i, 1i,);
+
+    let x: Foo<int,> = Foo::<int,>;
+
+    Bar::f(0i,);
+    Bar.g(0i,);
+    Bar.h();
+
+    let x = Qux(1,);
 }