Stéphane Campinas
f7a25a1177
warn on use of default value for an option
2018-06-30 17:03:18 +02:00
Seiichi Uchida
3027c21371
Handle raw identifiers
2018-06-25 23:36:45 +09:00
Nick Cameron
ca1c13a896
Merge pull request #2804 from Mike-Baker/mb-strip-vert-in-match-arms
...
Strip leading `|` in match arm patterns
2018-06-25 21:02:24 +12: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
Mike Baker
1d4b988414
Strip leading |
in match arm patterns
...
This addresses issue #2621
This commit turns out to be a partial revert of
ea3c01e3374143912f048b22fda106ee8d5a1cd8
The rationale is that a `|` character preceding a match pattern is not
semantically relevant and therefore should be considered a
style/formatting choice.
A discussion concluded that the best way to emit consistent formatting
here was to strip the leading `|`
This removes the match_with_beginning_vert test because it was asserting
the old behaviour which has been changed, it adds a new test
(issue_2621) which should be a more comprehensive check of the behavior
of `|` in match arms.
Discussion at https://github.com/rust-lang-nursery/fmt-rfcs/issues/119
2018-06-25 00:53:15 +01:00
Nick Cameron
87edd75ecf
TODO -> FIXME
...
Or just delete
Closes #25
2018-06-22 14:42:27 +12:00
Nick Cameron
1ead31ae9d
Merge pull request #2795 from jechase/issue-2794
...
Add test and fix for #2794
2018-06-20 10:35:16 +12:00
Nick Cameron
fb5513564e
Merge pull request #2785 from wada314/issue-2728
...
Fix #2728 .
2018-06-20 10:32:46 +12:00
Josh Chase
ee5ff2d9e8
Add flag to the ListFormatting struct for nested imports
2018-06-19 12:13:35 -04:00
Josh Chase
2077855e00
Remove NestedImport tactic
2018-06-19 12:13:26 -04:00
Shohei Wada
036244cdce
Fix #2728 .
2018-06-19 20:51:49 +09:00
Nick Cameron
488e6fda12
Remove some unnecessary pub
s
2018-06-19 14:36:50 +12:00
Nick Cameron
261238ea51
Change use_small_heuristics
to an enum and stabilise
...
Since it is now an enum, we can be future compatible since we can add variants
for different heuristics.
Closes #1974
2018-06-19 13:28:27 +12:00
Seiichi Uchida
0ec1533054
Merge pull request #2779 from thibaultdelor/stableApi
...
Improve end lines handling
2018-06-11 11:38:26 +09:00
Tibo Delor
2e90c4314c
Stop delaying Trailing whitespace error reporting
2018-06-10 14:19:09 +10:00
Tibo Delor
42efae5944
Clean Up code where last whitspace tracking isn't used
2018-06-10 14:07:33 +10:00
Tibo Delor
6b00b8b302
Move newline logic inside the formatting process.
...
Why?:
- Conceptually it sounds right
- Absolutely all write modes where doing it anyway
- It was done several times in some in case
- It greatly simplify the code
2018-06-10 00:25:47 +10:00
Tibo Delor
8c32a9d909
Parse Error return an Error instead of a successful empty response
2018-06-10 00:25:06 +10:00
Nick Cameron
34067a1c4c
Merge pull request #2775 from topecongiro/macro-def-with-complex-macro
...
Change format_snippet to return None when it has failed to format macro call
2018-06-08 08:50:35 +12:00
Seiichi Uchida
19054347ca
Fix test failures
2018-06-07 15:20:01 +09:00
Seiichi Uchida
c95fa8cbe2
Return None when the formatting of macro failed in format_snippet
2018-06-07 12:33:33 +09:00
Seiichi Uchida
d1477ca1de
Add a field in Summary for notiyfing about formatting failure of macro
2018-06-07 12:32:58 +09:00
Seiichi Uchida
94e68b1eb6
Set the flag in RewriteContext when rewriting macro call failed
2018-06-07 12:32:10 +09:00
csmoe
c791a54ff4
repair break_label format
2018-06-07 11:21:52 +08:00
Nick Cameron
da30d235a4
Merge pull request #2771 from topecongiro/issue-2746
...
Fix poor formatting of impls
2018-06-06 14:38:42 +12:00
Nick Cameron
576e9af0ae
Merge pull request #2769 from topecongiro/issue-2765
...
Put each nested import on its own line
2018-06-06 14:37:25 +12: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
Seiichi Uchida
42ab258757
Put each nested import on its own line
...
while putting non-nested imports on the same line as much as possible.
2018-06-05 19:58:44 +09:00
Nick Cameron
f545dfe95e
Fix tests
2018-06-05 20:58:02 +12:00
Nick Cameron
95b4978baa
Merge pull request #2767 from topecongiro/issue-2759
...
Fix breaking code block with `#` in doc comments
2018-06-05 20:28:32 +12:00
king6cong
56a3d039ce
update rustfmt flags that should work without targets
2018-06-05 15:43:48 +08:00
Seiichi Uchida
604764abe1
Trim custom comment prefix even when we failed to format code block
2018-06-05 15:58:14 +09:00
Seiichi Uchida
1b4778d0bc
Handle code block with indented escapce character
2018-06-05 15:57:49 +09:00
Seiichi Uchida
a70213b009
Trim custom comment prefixes from code block without closing backticks
2018-06-05 15:57:03 +09:00
Nick Cameron
d9149fb52e
Merge pull request #2741 from csmoe/where_brace
...
Remove newline in empty impl
2018-06-05 18:04:22 +12:00
Seiichi Uchida
b4987d848b
Allow using mixed layout with comments
2018-06-05 13:43:01 +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
Seiichi Uchida
2f65852946
Do not insert spaces around braces with empty body or multiple lines
2018-05-30 08:44:57 +09:00
Seiichi Uchida
966fe8d705
Fix treating the delimiter right after repeat as repeat as well
2018-05-30 08:44:57 +09:00
Alex Butler
f390626778
Update rustc-ap-* -> 149 ( #2748 )
2018-05-30 08:22:49 +09:00
Alex Butler
cd925f0140
Add mercy for devs that run cargo test
without building
2018-05-29 00:38:47 +01:00
Alex Butler
5473c3fd92
Update rustc-ap-* -> 148
2018-05-28 23:41:08 +01:00
Nick Cameron
173ae0d7b9
0.8.2
2018-05-28 11:47:21 +12:00
Nick Cameron
d930617cbe
Make Range public
...
0.8.1
2018-05-28 11:30:58 +12:00