Commit Graph

570 Commits

Author SHA1 Message Date
Seiichi Uchida
cc2afeca9e Fix compile errors from breaking changes 2018-06-28 16:26:10 +09:00
Seiichi Uchida
3027c21371 Handle raw identifiers 2018-06-25 23:36:45 +09:00
topecongiro
e5e1e0cea8 Fix compile errors from breaking changes in libsyntax
cc https://github.com/rust-lang/rust/pull/48149.
2018-06-25 15:24:00 +09:00
Nick Cameron
87edd75ecf TODO -> FIXME
Or just delete

Closes #25
2018-06-22 14:42:27 +12:00
Josh Chase
ee5ff2d9e8 Add flag to the ListFormatting struct for nested imports 2018-06-19 12:13:35 -04:00
Seiichi Uchida
a4db62368b Respect empty_item_single_line config option when formatting empty impls 2018-06-06 10:55:25 +09:00
Seiichi Uchida
d51b99f5d7 Put the where clause next to the closing bracket only when it is not indented 2018-06-06 10:54:40 +09:00
Seiichi Uchida
2e4376d29c Do not put where clause on a single with multi-lined type 2018-06-06 10:46:49 +09:00
Seiichi Uchida
8d01496c9e Remove unreachable lines 2018-06-06 10:46:18 +09:00
csmoe
faa41168a9 format exceeded comments 2018-06-05 07:35:51 +08:00
csmoe
8874c95a00 recover suppressed comma 2018-06-04 19:10:09 +08:00
csmoe
0468c134f4 snuggle where 2018-05-31 18:33:45 +08:00
csmoe
8536c288f2 suppress and compress 2018-05-31 17:58:48 +08:00
Nick Cameron
353816c596
Merge pull request #2730 from topecongiro/issue-2704
Disallow combining a method call with prefix or suffix
2018-05-23 20:10:49 +12:00
topecongiro
8cb2b8e909 Cargo fmt 2018-05-23 07:22:59 +09:00
topecongiro
a6b32d944c Fix breaking changes from introducing AnonConst 2018-05-23 06:04:32 +09:00
Thomas Lively
5d56adb10c Fix position of auto in auto trait declaration 2018-05-18 17:25:33 -04:00
Nick Cameron
d726492e65 Remove spaces_within_parens_and_brackets
cc #1974
2018-05-18 16:35:09 +12:00
Shotaro Yamada
d1e2b80fb9 Use saturating_sub 2018-05-15 20:41:43 +09:00
topecongiro
bd25c7d0f7 Cargo fmt 2018-05-08 06:25:48 +09:00
topecongiro
1f738ea208 Cargo fmt 2018-05-06 15:22:29 +09:00
topecongiro
37c216c50f Use bytepos to compare impl items 2018-04-30 16:19:52 +09:00
topecongiro
48e193c7f6 Factor out visit_impl_items 2018-04-30 16:13:51 +09:00
Nick Cameron
e554d8617d
Merge branch 'master' into imports_indent 2018-04-30 11:50:53 +12:00
Nick Cameron
dae9fb64b6
Merge pull request #2656 from topecongiro/issue-2594
Use consistent formatting for empty enum and struct
2018-04-30 11:06:33 +12:00
csmoe
f7415bcea2 update self format 2018-04-29 20:53:31 +08:00
Ryan Leung
fb9a5add9b add rustc_target to dependencies (#2660) 2018-04-28 16:08:58 +09:00
topecongiro
e512c19ed5 Use format_empty_struct_or_tuple over format_missing_no_indent
Closes #2594.
2018-04-28 14:03:14 +09:00
topecongiro
fb0c6affa5 Use format_empty_struct_or_tuple 2018-04-28 13:59:54 +09:00
topecongiro
82d8dd2f4b Factor out a formatting routine for empty struct and tuple 2018-04-28 13:59:03 +09:00
topecongiro
a955365459 Use a glob import for import utils 2018-04-28 13:24:05 +09:00
Seiichi Uchida
ac8ae00625
Cargo update and clippy (#2643) 2018-04-25 07:21:23 +09:00
Roman Stoliar
5b5a72c840 keep auto trait 2018-04-20 17:31:31 +03:00
csmoe
84d3659767 update rustc syntax 91.0.0 2018-04-08 22:22:11 +08:00
Seiichi Uchida
edcc7b69eb
Cargo update (#2602)
Update `rustc-ap-syntax` to 89.0.0 and fix up breaking changes.
2018-04-06 23:09:45 +09:00
Seiichi Uchida
fa80ddf876 Reorder impl items based on its kind
The ordering is defined as follows:

type < cosnt < macro < method

Items that are same kind will not be reordered: that is, the item
that an user has put first comes first.
2018-04-05 12:49:16 +09:00
Shotaro Yamada
56e10aa6e9 Fix typo 2018-04-01 22:29:26 +09:00
Shotaro Yamada
89200f40ff Remove unnecessary [..]s 2018-04-01 22:29:26 +09: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
Shotaro Yamada
4757321277 Don't index a string with chars().count() 2018-03-22 08:33:18 +09:00
Nick Cameron
50c95a074a cargo fmt 2018-03-20 09:27:31 +13:00
Nick Cameron
a76d9b529a format code and tests 2018-03-20 09:27:31 +13:00
Matthew McAllister
c5168405b0 Format attributes on block expressions 2018-03-14 01:16:19 +09:00
Seiichi Uchida
ccd134ed75 Add a test for #2497
Closes #2497.
2018-03-12 07:54:12 +09:00
Seiichi Uchida
b077297179 Modify the placement of the opening brace of trait
Put the opening brace on the next line if

1. putting it one the current line exceeds max width.
2. trait bounds uses multiple lines.
2018-03-12 07:54:12 +09:00
Seiichi Uchida
f56039c7e5 Use rewrite_assign_rhs for rewriting bounds 2018-03-12 07:54:12 +09:00
Seiichi Uchida
6ba7c34433 Use Option<SeparatorTactic> over bool to control trailing comma 2018-03-09 14:07:43 +09:00
Seiichi Uchida
2a99d9704f Use overflow::rewrite_with_angle_brackets to rewrite generics 2018-03-09 14:07:43 +09:00
Seiichi Uchida
ae629abc41 Add overflow module
This commit adds `overflow` module. This module provides two APIs.
`rewrite_with_parens` is basically the same as `rewrite_call_inner`.
`rewrite_with_angle_brackets` is used for rewriting generics and types.
2018-03-09 14:07:43 +09:00
Seiichi Uchida
71ca21fc23 Disallow combining parens and brackets in impl 2018-03-08 19:08:38 +09:00