diff options
| author | P1start <rewi-github@whanau.org> | 2014-08-21 16:37:15 +1200 |
|---|---|---|
| committer | P1start <rewi-github@whanau.org> | 2014-08-23 07:23:51 +1200 |
| commit | fde41a3f7026023ef968a41bcb256dc96a384e09 (patch) | |
| tree | 623ccb30502275e76b504929cb26139cb72c1f2d /src/test | |
| parent | eaf810a219b136fff67e75840ad3c5efde9ae1e5 (diff) | |
| download | rust-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.rs | 26 |
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,); } |
