Allow trailing commas in import lists. Closes #2582.
This commit is contained in:
parent
ce750a7dbc
commit
cce7327487
@ -2414,7 +2414,7 @@ class parser {
|
||||
token::LBRACE {
|
||||
let idents = self.parse_unspanned_seq(
|
||||
token::LBRACE, token::RBRACE,
|
||||
seq_sep_trailing_disallowed(token::COMMA),
|
||||
seq_sep_trailing_allowed(token::COMMA),
|
||||
{|p| p.parse_path_list_ident()});
|
||||
let path = @{span: mk_sp(lo, self.span.hi),
|
||||
global: false, idents: path,
|
||||
|
10
src/test/run-pass/import-trailing-comma.rs
Normal file
10
src/test/run-pass/import-trailing-comma.rs
Normal file
@ -0,0 +1,10 @@
|
||||
import foo::bar::{baz, quux,};
|
||||
|
||||
mod foo {
|
||||
mod bar {
|
||||
fn baz() { }
|
||||
fn quux() { }
|
||||
}
|
||||
}
|
||||
|
||||
fn main() { baz(); quux(); }
|
Loading…
x
Reference in New Issue
Block a user