Skip to content

Commit cce7327

Browse files
committed
Allow trailing commas in import lists. Closes rust-lang#2582.
1 parent ce750a7 commit cce7327

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/libsyntax/parse/parser.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2414,7 +2414,7 @@ class parser {
24142414
token::LBRACE {
24152415
let idents = self.parse_unspanned_seq(
24162416
token::LBRACE, token::RBRACE,
2417-
seq_sep_trailing_disallowed(token::COMMA),
2417+
seq_sep_trailing_allowed(token::COMMA),
24182418
{|p| p.parse_path_list_ident()});
24192419
let path = @{span: mk_sp(lo, self.span.hi),
24202420
global: false, idents: path,
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import foo::bar::{baz, quux,};
2+
3+
mod foo {
4+
mod bar {
5+
fn baz() { }
6+
fn quux() { }
7+
}
8+
}
9+
10+
fn main() { baz(); quux(); }

0 commit comments

Comments
 (0)