Commit Graph

558 Commits

Author SHA1 Message Date
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
Seiichi Uchida
5416c4df76 Modify code around ast::Visibility
`ast::Visibility` is changed to `codemap::Spanned` whose node is
`ast::VisibilityKind`. This commit fixes it.

Closes #2398.
2018-03-06 19:47:28 +09:00
Nick Cameron
39301ae5f2 Go back to a non-workspace structure
Kinda reverts https://github.com/rust-lang-nursery/rustfmt/pull/2419
2018-03-02 14:58:23 +13:00
topecongiro
4af2aa3a9e Create rustfmt_core crate 2018-02-07 22:48:05 +09:00
Nick Cameron
b7f01769f9
Merge branch 'master' into init-shorthand 2018-02-01 15:20:01 +13:00
Seiichi Uchida
c60d865b98 Put attributes and enum variants on different lines 2018-01-26 16:20:00 +09:00
Seiichi Uchida
154bf8e1af Cargo fmt 2018-01-22 13:05:18 +09:00
Nick Cameron
74a957e80f
Merge pull request #2357 from topecongiro/issue-2342
Put attributes and struct fields on different line by default
2018-01-12 17:32:55 +13:00
Nick Cameron
b356fc06f7
Merge pull request #2352 from topecongiro/issue-2337
Break after colon if static item does not fit in a single line
2018-01-12 17:31:12 +13:00
Seiichi Uchida
2420d346c5 Put attributes and struct fields on different line 2018-01-11 16:57:12 +09:00
Seiichi Uchida
eaab51db2e Break after colon if static item does not fit in a single line 2018-01-10 23:23:42 +09:00
Seiichi Uchida
cb0b366b38 Cargo fmt 2018-01-10 17:17:06 +09:00
topecongiro
19d6a3c786 Put the opening brace of impl on the next line
We put the opening brace on the next line if the following conditions hold:

1. the result before '{' ends with comments or contains newline
2. the last line of the result before '{' is not extendable (i.e. consists of
   '>' and whitespaces).
2018-01-04 12:46:55 +09:00