diff options
| author | Bekh-Ivanov Aleksey <bekh6ex@users.noreply.github.com> | 2016-11-14 07:42:15 +0300 |
|---|---|---|
| committer | Nick Cameron <nrc@ncameron.org> | 2016-11-14 17:42:15 +1300 |
| commit | 935286755cbe08ba6beea31b3b8a83cd166a85f2 (patch) | |
| tree | cfcd77bb1fd8b84f2893c2df1a655c58fb5acc77 /src | |
| parent | 49ce1b641a5c30a46c805151679c88f68c633742 (diff) | |
Stripping trailing commas and spaces from `vec!` elements (#1219)
* Stripping trailing commas and spaces from `vec!` elements * Stripping trailing commas and spaces ONLY from `vec!` elements * Added comment
Diffstat (limited to 'src')
| -rw-r--r-- | src/macros.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/macros.rs b/src/macros.rs index dd301ad9de7..250fd81099c 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -114,7 +114,12 @@ pub fn rewrite_macro(mac: &ast::Mac, parser.bump(); if parser.token == Token::Eof { - return None; + // vec! is a special case of bracket macro which should be formated as an array. + if macro_name == "vec!" { + break; + } else { + return None; + } } } } |
