Commit Graph

3227 Commits

Author SHA1 Message Date
rleungx
bf3bf8c235 allow underscore 2018-03-28 00:31:44 +08:00
Nick Cameron
53ecabad04
Merge pull request #2556 from topecongiro/issue-2554
Do not add the beginning vert to the match arm
2018-03-26 18:01:24 +13:00
Seiichi Uchida
903de92dae Avoid cloning RewriteContext 2018-03-25 20:20:50 +09:00
Seiichi Uchida
1e1d9d4afe Do not add the beginning vert to the match arm
Pass the span after the match's condition expression.
Closes #2554.
2018-03-23 19:59:38 +09:00
Nick Cameron
2fbdedbf2f
Merge pull request #2549 from topecongiro/macro-def-spaces-around-colon
Add config option to control spaces around colon in macro def
2018-03-23 10:51:47 +13:00
Nick Cameron
50924839e8
Merge pull request #2553 from topecongiro/rustc-ap-syntax
Update rustc-ap-syntax to 73.0.0
2018-03-23 10:50:41 +13:00
topecongiro
ccec777f92 Cargo fmt and update tests 2018-03-22 16:09:21 +09:00
topecongiro
6115dcdbdc Remove a space after a colon of metavariable def in macro def 2018-03-22 16:08:57 +09:00
topecongiro
d7c7991ed1 Update a test 2018-03-22 16:01:41 +09:00
topecongiro
b58a113370 Use UseSegment::Slf or UseSegment::Super when appropriate
Currently we `UseSegment::Ident` for all of the segments except the last.
E.g. `use super::foo::bar::self;` will be
`[Ident("super"), Ident("foo"), Ident("bar"), Self(None)]`.
in the current implementation. I think that this should be
`[Super(None), Ident("foo"), Ident("bar"), Self(None)]`.
instead.

I noticed this because some tests failed after updating
`rustc-ap-syntax` to 73.0.0.
2018-03-22 15:56:51 +09:00
topecongiro
846f4f21db Fix libsyntax updates
`ast::UseTreeKind::Simple` now takes `Option<ast::Ident>`
instead of `ast::Ident`.
2018-03-22 15:55:14 +09:00
topecongiro
51d5696977 Fix libsyntax update
Underscore is now one of keywords.
2018-03-22 15:53:43 +09:00
topecongiro
32ab7f4967 Cargo update
Update rustc-ap-syntax to 73.0.0.
2018-03-22 15:53:08 +09:00
Nick Cameron
374dba833e
Merge pull request #2552 from alanhdu/master
Close #2551
2018-03-22 18:04:31 +13:00
Alan Du
d402cd20a8 Close #2551 2018-03-22 00:57:22 -04:00
Alan Du
d8723aaa8c Fix build 2018-03-22 00:01:09 -04:00
Nick Cameron
ff9ab51617
Merge pull request #2550 from sinkuu/chars_count_index
Don't index a string with chars().count()/position()
2018-03-22 16:26:48 +13:00
Nick Cameron
0bc0241d2a
Merge pull request #2548 from topecongiro/match-mod
Do not collapse block around expr with condition on match arm
2018-03-22 15:40:36 +13:00
Nick Cameron
c593229171
Merge pull request #2535 from nrc/import-ord
Import ordering
2018-03-22 15:08:01 +13:00
Shotaro Yamada
83c8d23cc2 Omit unnecessary UTF-8 decoding 2018-03-22 08:34:53 +09:00
Shotaro Yamada
e5572bbb66 Use take_while 2018-03-22 08:34:36 +09:00
Shotaro Yamada
4757321277 Don't index a string with chars().count() 2018-03-22 08:33:18 +09:00
Seiichi Uchida
5b9b7d5b9f Do not collapse block around expr with condition on match arm
Closes #2376.
2018-03-21 22:21:08 +09:00
Seiichi Uchida
88589f2ad8 Add matches module
`matches` module contains `rewrite_match` and related stuffs.
2018-03-21 22:21:08 +09:00
Nick Cameron
3a138a24a3 Return grouping extern crate to true by default 2018-03-20 09:54:00 +13:00
Nick Cameron
bf9f175336 reviewer comments and rebase fallout 2018-03-20 09:27:31 +13:00
Nick Cameron
0cf80dcce7 Better handle comments and newlines around erased imports 2018-03-20 09:27:31 +13:00
Nick Cameron
fa75ef4663 fixup tests 2018-03-20 09:27:31 +13:00
Nick Cameron
50c95a074a cargo fmt 2018-03-20 09:27:31 +13:00
Nick Cameron
4cfffbd0a8 Reimplement import reordering. 2018-03-20 09:27:31 +13:00
Nick Cameron
a76d9b529a format code and tests 2018-03-20 09:27:31 +13:00
Nick Cameron
164cf7d6c9 Reorder imports by default 2018-03-20 09:26:10 +13:00
Nick Cameron
5516223900
Merge pull request #2542 from topecongiro/macro-2.0
Handle macro arguments which exceeds max width
2018-03-19 15:13:47 +13:00
Seiichi Uchida
adc257f4b3 Put a space before colon that appears after a meta variable
Closes #2534.
2018-03-19 08:27:53 +09:00
Seiichi Uchida
f8109f8e9c Put spaces around braces 2018-03-19 08:23:53 +09:00
Seiichi Uchida
96a83b57e5 Add some doc comments and factor out add_repeat and add_delimited 2018-03-19 08:23:53 +09:00
Seiichi Uchida
0fd174d5f1 Handle binary operators and lifetimes 2018-03-19 08:23:53 +09:00
Seiichi Uchida
3f7b59ca2b Break before meta variables when using multiple lines 2018-03-19 08:23:53 +09:00
Seiichi Uchida
95507e3a43 Remove has_prefix_space 2018-03-19 08:23:53 +09:00
Seiichi Uchida
ec71459c44 Format macro arguments with vertical layout 2018-03-19 08:23:53 +09:00
Seiichi Uchida
84ea306d32 Remove unit tests 2018-03-19 08:23:53 +09:00
Seiichi Uchida
c9701d8e18 Update tests 2018-03-19 08:23:53 +09:00
Nick Cameron
56d2a08db0
Merge pull request #2541 from topecongiro/issue-2358
Skip name replacement in comments and strings
2018-03-19 08:55:35 +13:00
Nick Cameron
b7bc720638
Merge pull request #2540 from topecongiro/version
Fix print_version
2018-03-19 08:53:31 +13:00
Seiichi Uchida
1a969cff7f Remove FIXME about duplicated code 2018-03-17 14:59:39 +09:00
Seiichi Uchida
d7188654ea Skip name replacement in comments and strings 2018-03-17 14:59:26 +09:00
Seiichi Uchida
9cc038897e Add a test for #2538 2018-03-17 14:58:56 +09:00
Seiichi Uchida
ca6fc67e60 Fix print_version 2018-03-17 12:16:15 +09:00
topecongiro
87180d9065 0.4.1 2018-03-16 08:58:25 +09:00
topecongiro
a03b3b7d6f Cargo update
Remove `rustc-ap-rustc_errors` from dependencies since it
is re-exported from `rustc-ap-syntax`.
2018-03-16 08:52:36 +09:00