mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-04 19:29:07 +00:00
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 {
|
token::LBRACE {
|
||||||
let idents = self.parse_unspanned_seq(
|
let idents = self.parse_unspanned_seq(
|
||||||
token::LBRACE, token::RBRACE,
|
token::LBRACE, token::RBRACE,
|
||||||
seq_sep_trailing_disallowed(token::COMMA),
|
seq_sep_trailing_allowed(token::COMMA),
|
||||||
{|p| p.parse_path_list_ident()});
|
{|p| p.parse_path_list_ident()});
|
||||||
let path = @{span: mk_sp(lo, self.span.hi),
|
let path = @{span: mk_sp(lo, self.span.hi),
|
||||||
global: false, idents: path,
|
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…
Reference in New Issue
Block a user