Commit graph

2069 commits

Author SHA1 Message Date
Nick Cameron
0156fe07ac
Merge pull request #2589 from topecongiro/issue-2588
Do not indent or unindent inside string literal
2018-04-05 17:36:15 +12:00
Nick Cameron
a318bc887f
Merge pull request #2580 from remram44/improve-where_single_line-help
Improve `where_single_line` help
2018-04-05 17:34:53 +12:00
Seiichi Uchida
ec1907b2a4 Do not indent or unindent inside string literal
Closes #2588.
2018-04-05 12:52:43 +09:00
Seiichi Uchida
89070a2244 Implement LineClasses 2018-04-05 12:52:43 +09:00
memoryleak47
d48cbedfe4 typo (#2598)
* typo

* more typos
2018-04-05 12:47:09 +09:00
Marthog
bc05621f9b Let --dump-default-config default to stdout #2579 (#2586) 2018-04-01 23:15:25 +09:00
Seiichi Uchida
dec307b2fa
Merge pull request #2584 from sinkuu/cleanup
Misc cleanups
2018-04-01 23:14:52 +09:00
Shotaro Yamada
e2d801f11e Do not turn spaces in the beginning of the file into a newline (#2583) 2018-04-01 23:09:53 +09:00
Shotaro Yamada
56e10aa6e9 Fix typo 2018-04-01 22:29:26 +09:00
Shotaro Yamada
3467b4dafe Use ListItem::has_comment 2018-04-01 22:29:26 +09:00
Shotaro Yamada
ba792a7fa2 Remove redudant parens 2018-04-01 22:29:26 +09:00
Shotaro Yamada
71448ff3c2 Return String instead of always returing Cow::Owned 2018-04-01 22:29:26 +09:00
Shotaro Yamada
39e85281f3 Remove stray comment
Its pointee was removed in 04a6d16c7b
2018-04-01 22:29:26 +09:00
Shotaro Yamada
a2325375ed Do not collect into a Vec by hand 2018-04-01 22:29:26 +09:00
Shotaro Yamada
89200f40ff Remove unnecessary [..]s 2018-04-01 22:29:26 +09:00
Shotaro Yamada
6b3811a358 Use Iterator methods 2018-04-01 22:29:26 +09:00
Shotaro Yamada
ed46a777c8 Use str::repeat 2018-04-01 22:29:26 +09:00
Remi Rampin
37ee9c20aa Improve where_single_line help 2018-03-31 18:51:41 -04:00
Seiichi Uchida
73e7235317
Cargo update (#2575)
Update `rustc-ap-syntax` to 82.0.0.
2018-03-30 17:52:09 +09:00
Seiichi Uchida
3de184fb0e
Merge pull request #2572 from codeworm96/remove_unreachable
Remove unreachable! from macros.rs
2018-03-29 09:16:38 +09:00
codeworm96
e68682f6db Remove unreachable! from macros.rs
replaced unreachable! with error handling using Option.

Closes #2558
2018-03-28 23:38:34 +08:00
Nick Cameron
72b715bad4
Merge pull request #2571 from topecongiro/issue-2569
Avoid panicking on macro call with a single comma
2018-03-28 17:02:49 +02:00
Nick Cameron
1644b174a7
Merge pull request #2557 from topecongiro/vertical-layout-complex-attrs
Use vertical layout for complex attributes
2018-03-28 17:01:16 +02:00
Nick Cameron
8dd08ddd92
Merge pull request #2562 from topecongiro/issue-2196
Combine simple heuristics for function calls and array
2018-03-28 16:49:25 +02:00
Seiichi Uchida
a49e00b4d7 Avoid panicking on macro call with a single comma
`parse_item` from libsyntax may return `None`, so we need to discard
the result in that case.
2018-03-28 18:14:51 +09:00
Seiichi Uchida
efd295a4e1 Follow indent style config when formatting attrs 2018-03-28 17:42:17 +09:00
Seiichi Uchida
0f55350c7d
Merge pull request #2563 from rleungx/allow-underscore
allow underscore in macro_rules!
2018-03-28 12:41:51 +09:00
rleungx
bf3bf8c235 allow underscore 2018-03-28 00:31:44 +08:00
Taylor Cramer
72d8c9143b Allow stabilization of match_default_bindings 2018-03-26 22:29:01 +02: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
48424ea765 Update tests and cargo fmt 2018-03-26 07:38:39 +09:00
Seiichi Uchida
98c6f7b731 Format array using overflow module
This commit applies heuristics used for function calls to array
and vice versa.
2018-03-26 07:36:44 +09:00
Seiichi Uchida
affa4ce1ec Factor out default_tactic and fix indentation
rustfmt fails to handle binary expressions with comments in-between.
2018-03-26 07:34:17 +09:00
Seiichi Uchida
cf6c67e1a6 Replace MacroStyle with ast::DelimToken 2018-03-26 07:32:48 +09:00
Seiichi Uchida
903de92dae Avoid cloning RewriteContext 2018-03-25 20:20:50 +09:00
topecongiro
c77708ff9a Use vertical layout for complex attributes 2018-03-25 15:17:41 +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
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
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
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
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