WhizSid
7d9ee7558e
Comment between typebounds ( #4474 )
...
* Test cases and get spans
* Fixed type bounds
* Fixed issue of test cases
* Fixed first test case issue
* Removed unwanted whitespaces
* Removed tmp files
2020-11-29 13:26:58 -06:00
Caleb Cartwright
823c4f820a
fix: backport some imports for cherry-picked commit
2020-11-29 13:26:58 -06:00
WhizSid
b7c38c9d50
Fixed comment dropped between & and type issue ( #4482 )
...
* Fixed comment dropped between & and type issue
* Reduced nesting levels and avoided duplications
* Removed extra allocations
2020-11-29 13:26:58 -06:00
WhizSid
6455e9de0e
Fixed 'Comment removed between type name and =' issue ( #4448 )
...
* Fixed Comment removed between type name and = issue
* Fixed where clause issue and pass the full span
* has_where condition inline
* Fixed indentation error on where clause
* Removed tmp file
2020-11-29 13:26:58 -06:00
Caleb Cartwright
ea712f1a2c
fix: apply rustc-ap updates to backported commit
2020-11-29 13:26:58 -06:00
hafiz
5e7fb45533
Pick up comments between visibility modifier and item name ( #4239 )
...
* Pick up comments between visibility modifier and item name
I don't think this hurts to fix. #2781 , which surfaced this issue, has
a number of comments relating to similar but slightly different issues
(i.e. dropped comments in other places). I can mark #2781 as closed and
then will open new issues for the comments that are not already resolved
or tracked.
Closes #2781
* fixup! Pick up comments between visibility modifier and item name
* fixup! Pick up comments between visibility modifier and item name
2020-11-29 13:26:58 -06:00
Caleb Cartwright
fb7e604538
tests: backport an additional test case
2020-11-29 13:26:58 -06:00
Adam H. Leventhal
3df383aa3c
fixes #4115 , #4029 , #3898
2020-11-29 13:26:58 -06:00
hafiz
c77c6a405d
Compare code block line indentation with config whitespace ( #4166 )
...
Previously the indetation of a line was compared with the configured
number of spaces per tab, which could cause lines that were formatted
with hard tabs not to be recognized as indented ("\t".len() < " ".len()).
Closes #4152
2020-11-29 13:26:58 -06:00
Ayaz Hafiz
3bf67c175d
Don't drop blocks on foreign functions
...
A code like
```rust
extern "C" {
fn f() {
fn g() {}
}
}
```
is incorrect and does not compile. Today rustfmt formats this in a way
that is correct:
```rust
extern "C" {
fn f();
}
```
But this loses information, and doesn't have to be done because we know
the content of the block if it is present. During development I don't
think rustfmt should drop the block in this context.
Closes #4313
2020-11-28 21:59:30 -06:00
Ayaz Hafiz
5ffccbb627
Properly format function signature in extern blocks
...
Closes #4288
And we get to drop a method, which I think is a win :)
2020-11-28 21:59:30 -06:00
Caleb Cartwright
48d30a4f71
chore: run rustfmt against source
2020-11-28 17:41:21 -06:00
Caleb Cartwright
4d9fa00fd5
feat: support underscore expressions
2020-11-28 17:41:21 -06:00
Caleb Cartwright
5c0673c371
refactor: update cfg_if attr parsing
2020-11-28 17:41:21 -06:00
Caleb Cartwright
4f32ce8434
feat: support struct/slice destructuring
2020-11-28 17:41:21 -06:00
Caleb Cartwright
5b216029b5
deps: minor rustc_ast changes for v691
2020-11-28 17:41:21 -06:00
Caleb Cartwright
581da523db
deps: bump rustc-ap to v687
2020-11-28 17:41:21 -06:00
meiomorphism
003786228d
fix: don't force a newline after an empty where clause
...
Fixes #4547 .
2020-11-25 21:32:46 -06:00
Matt
073cc3891f
Option to create groups for std, external crates, and other imports
...
Backport of 17d90ca.
2020-11-18 21:37:42 -06:00
Caleb Cartwright
89f38304a7
fix: don't drop leading comments in extern
2020-11-16 15:48:20 -06:00
WhizSid
faf97a67d6
Fixed 'Incorrect comment indent inside if/else' issue. ( #4459 )
...
* Added test cases
* Fixed if condition comment issue
* Fixed extern C issue
* Removed previous test case
* Removed tmp file
* honor the authors intent
* Changed the file name to its original name
* Removed extra whitespace
2020-11-14 11:50:28 -06:00
Ayaz Hafiz
ce13ff15c3
Correctly create artificial span for formatting closure body
...
This commit partially reverts #3934 , opting to create a span that covers
the entire body of a closure when formatting a closure body with a
block-formatting strategy, rather than having the block-formatting code
determine if the visitor pointer should be rewound. The problem with
rewinding the visitor pointer is it may be incorrect for other (i.e.
non-artificial) AST nodes, as in the case of #4382 .
Closes #4382
2020-11-14 11:50:28 -06:00
Caleb Cartwright
a613c57521
feat: don't insert semi in macro_rules arm body
2020-11-11 18:26:13 -06:00
Caleb Cartwright
ae6b40e2f9
fix: remove ignored depr attribute which now errors
2020-11-05 20:45:11 -06:00
Caleb Cartwright
1139e6e5cc
fix: remove comment from cherry-pick that v1.x doesn't handle
2020-11-05 20:45:11 -06:00
Aaron Hill
46ab14437e
Don't flatten a block containing a single macro call
...
We no longer flatten a block that looks like this:
```rust
match val {
pat => { macro_call!() }
}
```
Currently, rust ignores trailing semicolons in macro expansion in
expression position (see https://github.com/rust-lang/rust/issues/33953 )
If this is changed, flattening a block with a macro call may break the
user's code - the trailing semicolon will no longer parse if the macro
call occurs immediately on the right-hand side of the match arm
(e.g. `pat => macro_call!()`)
2020-11-05 20:45:11 -06:00
Caleb Cartwright
15854e5fd3
feat: v2 support for nested tuples w/o spaces
2020-11-02 18:31:51 -06:00
Caleb Cartwright
98975e1a64
tests: adjust some cherry-picekd tests
2020-11-02 18:31:51 -06:00
Caleb Cartwright
2b6226ce49
fix: resolve some parser related bugs
2020-11-02 18:31:51 -06:00
Caleb Cartwright
86a41bc80b
tests: add test for panic on new_parser_from_file
2020-11-02 18:31:51 -06:00
Caleb Cartwright
9faba4539b
fix(parser): better unclosed delims handling
2020-11-02 18:31:51 -06:00
Caleb Cartwright
e131797b62
deps: bump rustc-ap to v686
2020-11-02 18:31:51 -06:00
Michael Müller
fa9d97499e
Fix overriding license header bug ( #4488 )
...
* Override header to None when path len = 0
* Add regression test
* Ensure nightly
2020-10-24 11:14:52 -05:00
hafiz
6a7824787e
Preserve comments in empty statements ( #4180 )
...
* Preserve comments in empty statements
Closes #4018
* fixup! Preserve comments in empty statements
2020-10-24 11:13:00 -05:00
Ayaz Hafiz
e70343a5f5
Correctly indent skipped-over code
...
Closes #4398
2020-10-24 11:13:00 -05:00
Caleb Cartwright
31cef56779
feat: add initial support for ConstBlock expressions
2020-10-24 11:13:00 -05:00
Caleb Cartwright
c89638ae55
deps: update macro parsing
2020-10-24 11:13:00 -05:00
David Tolnay
14d53f75c9
Use rustfmt given by RUSTFMT env var ( #4419 )
2020-10-04 16:58:34 -05:00
Ayaz Hafiz
2a8ff209f6
fixup! Preserve and format type aliases in extern blocks
2020-10-01 19:12:22 -05:00
Ayaz Hafiz
92ab76cfa7
fixup! Preserve and format type aliases in extern blocks
2020-10-01 19:12:22 -05:00
Ayaz Hafiz
a9b0b057eb
fixup! Preserve and format type aliases in extern blocks
2020-10-01 19:12:22 -05:00
Ayaz Hafiz
a15800a327
Preserve and format type aliases in extern blocks
...
Previously, non-trivial type aliases in extern blocks were dropped by
rustfmt because only the type alias name would be passed to a rewritter.
This commit fixes that by passing all type information (generics,
bounds, and assignments) to a type alias rewritter, and consolidates
`rewrite_type_alias` and `rewrite_associated_type` as one function.
2020-10-01 19:12:22 -05:00
Caleb Cartwright
d6a220b70a
feat: support config. of leading match arm pipe
2020-09-24 09:43:31 -05:00
David Tolnay
8635a5ca44
deps: bump rustc-ap to v679
2020-09-23 00:45:18 -05:00
Caleb Cartwright
9ba373f822
deps: bump rustc-ap to v678
2020-09-23 00:45:18 -05:00
Caleb Cartwright
62dc7c5c6b
fix: inner attribute formatting
2020-09-04 19:01:18 -05:00
mahkoh
89b7f5f382
Fix module resolution in inner modules with paths ( #4194 )
2020-09-04 19:01:18 -05:00
Caleb Cartwright
aa11c27490
chore: run rustfmt
2020-09-04 19:01:18 -05:00
Caleb Cartwright
637ddfb6da
deps: bump rustc-ap to v673
2020-09-04 19:01:18 -05:00
Caleb Cartwright
e4617e0e61
deps: bump rustc-ap to v672
2020-09-04 19:01:18 -05:00
Caleb Cartwright
a17803127f
fix: inverted span on attrs within closure
2020-08-09 14:32:34 -05:00
Caleb Cartwright
bf359c6ebc
chore: backport 8157a3f0afe978d3e953420577f8344db7e905bf
2020-07-15 09:19:21 -05:00
Caleb Cartwright
391cd3e324
deps: bump rustc-ap to v669
2020-07-14 21:36:24 -05:00
Caleb Cartwright
b243075d75
deps: bump rustc-ap-* to v668
2020-07-09 23:15:08 -05:00
Caleb Cartwright
da18032ba4
deps: bump rustc-ap* to v666
2020-06-27 13:15:54 -05:00
Seiichi Uchida
a36e7c7981
Use correct span for match arms with the leading pipe and attributes ( #3975 )
2020-06-27 12:55:15 -05:00
Caleb Cartwright
796d6eafa4
fix: backport fix for #4079
2020-06-11 23:29:51 -05:00
Caleb Cartwright
5db7152962
fix: backport fix for #4020
2020-06-11 23:17:38 -05:00
Caleb Cartwright
ce1a3efff0
fix: backport fix for submod parser errors
2020-06-11 21:49:40 -05:00
Caleb Cartwright
dead3a807d
fix: backport mod resolution error handling
2020-06-11 21:11:18 -05:00
David Tolnay
bc9a0b2974
Switch to std::error::Error for errors ( #3948 )
2020-06-11 20:23:24 -05:00
Caleb Cartwright
b28fd5f91c
deps: apply upstream rustc-* changes
2020-06-11 13:22:37 -05:00
topecongiro
08776ef3b4
Support module-level rustfmt::skip in sub-modules
2020-06-08 10:42:43 +09:00
Seiichi Uchida
577ef8136f
Update rustc-ap-* crates to 659.0.0 for rustfmt-1.4.15 ( #4184 )
2020-05-19 17:31:28 +09:00
Caleb Cartwright
c1267303bc
fix: formatting arbitrary extern abi ( #4089 )
2020-03-31 15:30:26 +09:00
Caleb Cartwright
00e199c974
backport new syntax to rustfmt 1.x ( #4105 )
...
* feat: support raw reference operator
* feat: support const opt-out syntax
* feat: support half open range syntax
2020-03-31 15:28:01 +09:00
Caleb Cartwright
9714a140c9
refactor: use ast::attr:HasAttrs
2020-03-30 13:11:00 -05:00
Caleb Cartwright
ac2d5b85a5
deps: bump rustc-ap* to v651
2020-03-30 12:02:39 -05:00
Caleb Cartwright
b173b42354
refactor: rename libsyntax --> rustc_ast
2020-03-27 22:29:12 -05:00
Caleb Cartwright
c1a66e1e22
fix: unreachable err on Fn with None
block
2020-03-27 22:13:46 -05:00
Caleb Cartwright
537d746e08
fix: use correct ForeignItem span
2020-03-27 22:00:00 -05:00
Caleb Cartwright
bea7209d0a
chore: fix src formatting
2020-03-27 21:53:40 -05:00
Caleb Cartwright
9b0ed57af6
refactor: parse & mod resolver for rustc-ap v650
2020-03-27 21:33:34 -05:00
Caleb Cartwright
bd5dff4012
refactor: backport syntux mod
2020-03-26 21:25:34 -05:00
Caleb Cartwright
9699c96cf1
deps: bump to rustc v647
2020-03-26 17:20:24 -05:00
Caleb Cartwright
7a76ec062d
deps: bump to rustc v644
2020-03-26 15:26:58 -05:00
Caleb Cartwright
760bb29feb
chore: fix compile warnings
2020-02-08 22:54:37 -06:00
Caleb Cartwright
e72f307f15
fix: backport parse bug fix
...
Backport the fix for the parser bug where the messages from
fatal/non-recoverable parser errors were being silently eaten by
rustfmt.
2020-02-08 22:47:48 -06:00
Caleb Cartwright
c60416ed21
deps: update rustc-ap to v642.0.0
2020-02-08 22:21:37 -06:00
Seiichi Uchida
731f15551b
Do not add block around async closure ( #3946 )
2019-12-03 08:47:25 +09:00
Chris Emerson
99f9f576d4
Return an error if --check
or --emit json
are used with stdin. ( #3875 )
2019-10-25 15:05:24 +09:00
Seiichi Uchida
69cf48344b
fix handling of nested comments in patterns and ControlFlows ( #3869 )
2019-10-25 15:04:33 +09:00
rChaser53
233497aceb
fix Unparsable code when formmating ( #3883 )
2019-10-24 22:16:56 +09:00
Rui
69c7dbcd50
Try to solve issue3456. ( #3556 )
2019-10-19 18:19:47 +09:00
Caleb Cartwright
3a073f177c
fix: handling of newline_style conflicts ( #3850 )
2019-10-19 17:15:13 +09:00
Stéphane Campinas
5327c3633f
handle field attributes when aligning a struct's fields ( #3513 )
2019-10-19 16:56:32 +09:00
Caleb Cartwright
a5d16df9a4
feat: use offline by default with cargo fmt ( #3830 )
2019-10-19 16:35:33 +09:00
Caleb Cartwright
fd6e960648
fix: comments between lhs and rhs
2019-10-17 20:13:11 -05:00
Caleb Cartwright
28be77915f
fix: nested comments in control flow condition pat
2019-10-17 19:58:08 -05:00
Stéphane Campinas
a15e97f1e9
do not indent impl generics ( #3856 )
2019-10-11 18:19:44 +09:00
Caleb Cartwright
8210cc1c13
fix: handle lhs unary in range expression ( #3855 )
2019-10-11 18:15:04 +09:00
rChaser53
396a2af181
fix to swallow attribute on brace expression ( #3848 )
2019-10-10 10:35:34 +09:00
Caleb Cartwright
207a58f365
fix panic on closure with empty block expr ( #3846 )
2019-10-08 11:00:31 +09:00
Caleb Cartwright
6dcbc5d78e
fix: handle block comments with trailing line comments ( #3842 )
2019-10-08 10:12:21 +09:00
Stéphane Campinas
8073244420
improve detection of URL inside a string that is being rewritten. ( #3809 )
2019-10-07 16:43:50 +09:00
Stéphane Campinas
160c3aafc5
handle hard tabs when formatting trailing comments ( #3836 )
2019-10-07 16:40:27 +09:00
Caleb Cartwright
ba4bf03d84
don't fail on recoverable parser errors in ignored files ( #3782 )
2019-10-07 10:24:08 +09:00
Caleb Cartwright
ed697c9347
fix: support raw prefix identifiers in statics
2019-10-05 12:34:48 -05:00
Seiichi Uchida
383306e5fe
Update rustc-ap-* crates to 606.0.0 ( #3835 )
2019-10-05 23:40:24 +09:00
Stéphane Campinas
fb01dc857c
do not force comments to be indented with a comment trailing a line of code ( #3833 )
2019-10-05 00:22:01 +09:00
rChaser53
7926851bb0
stop to strip 'impl' from impl trait type alias ( #3816 )
2019-10-04 11:25:16 +09:00
Matthew Pomes
e28ae8b4a3
Init Logger for unit tests ( #3829 )
...
Add `init_log()` function which attempts to init logger, and
ignores failure. The function is called at the beginning of
every test, and will fail if the logger is already initialized.
The logger must be initialized in every test, becuase cargo runs
the tests in parallel, with no garentees about the order and time
each starts.
2019-10-04 11:24:33 +09:00
Stéphane Campinas
dbd8936391
fix rust code in comment with a line containing only a hash sign ( #3818 )
2019-10-02 23:58:25 +09:00
Caleb Cartwright
f4bc494153
add --offline mode fallback to cargo fmt ( #3813 )
2019-10-02 23:56:20 +09:00
Caleb Cartwright
7c9c0d1a39
fix: merge_imports handling of ::{self}
2019-09-26 20:02:41 -05:00
Caleb Cartwright
9c2b375ba9
refactor to use param naming where appropriate ( #3803 )
2019-09-24 09:25:19 +09:00
Caleb Cartwright
3bb266180e
fix: handling of empty str for license template path ( #3804 )
2019-09-24 09:24:05 +09:00
Caleb Cartwright
6b0a447150
feat: support parameter attributes ( #3793 )
2019-09-20 16:11:52 +09:00
rChaser53
4449250539
fix the error with long string in raw string ( #3800 )
2019-09-18 22:39:27 +09:00
Shotaro Yamada
ca78653d61
Use Cell instead of RefCell ( #3798 )
2019-09-18 22:37:08 +09:00
rChaser53
789a097a71
fix internal error when using rustfmt::skip with newline on stmt ( #3785 )
2019-09-15 23:45:46 +09:00
Caleb Cartwright
dfe87fe946
fix: async expression indentation ( #3789 )
2019-09-11 09:55:18 +09:00
Seiichi Uchida
ceca01465a
Update deps ( #3788 )
2019-09-08 23:33:21 +09:00
Seiichi Uchida
5baba86fe5
Update rustc-ap-* crates to 581.0.0 ( #3783 )
2019-09-06 22:41:03 +09:00
rChaser53
1ded995ee7
fix 'left behind trailing whitespace' ( #3761 )
2019-09-05 19:38:00 +09:00
Seiichi Uchida
783948fcbb
Fix handling of match arm's rewrite ( #3775 )
2019-09-05 11:15:46 +09:00
CreepySkeleton
e81ec20af0
Add --config command line option ( #3767 )
2019-09-05 11:15:19 +09:00
Valentine Valyaeff
15a28f79b8
Another fix for merge_imports
( #3769 )
2019-09-04 23:02:10 +09:00
Andrey
950b288d6f
do not remove discriminant value if exists ( #3771 ) ( #3772 )
2019-09-04 23:01:04 +09:00
rChaser53
2bf67b6e5c
fix TrailingWhitespace when using line breaks in macros arguments ( #3768 )
2019-09-04 23:00:26 +09:00
Caleb Cartwright
ad5d9fba9b
fix formatting mods inside cfg_if macro ( #3763 )
2019-09-02 18:36:51 +09:00
Seiichi Uchida
deb329a6bb
Forbid adding or removing a block from match arms inside macro calls ( #3756 )
2019-08-28 20:50:41 +09:00
rChaser53
a09ca681de
fix the bug removing attrs ( #3760 )
2019-08-28 20:50:02 +09:00
Valentine Valyaeff
ef00f74ce3
Merge imports fix ( #3753 )
2019-08-27 11:23:55 +09:00
Caleb Cartwright
c26c0e5abf
feat: add support for --message-format option ( #3752 )
2019-08-27 09:27:32 +09:00
Caleb Cartwright
9792ff0529
Fix line numbers in checkstyle output ( #3694 )
2019-08-19 11:11:35 +09:00
Caleb Cartwright
62432fe31b
add new flag to list names of misformatted files ( #3747 )
2019-08-19 11:04:40 +09:00
Seiichi Uchida
73847d3986
Take the inner macro_use attr into acocunt while reordering ( #3749 )
2019-08-19 10:56:32 +09:00
Seiichi Uchida
1643d726ef
Use correct indent when formatting complex fn type ( #3731 )
2019-08-16 11:15:28 +09:00
Caleb Cartwright
dfd27663dc
add json emit mode ( #3735 )
2019-08-16 11:14:53 +09:00
Caleb Cartwright
541d9a8659
tests: fix failing default config unit test ( #3743 )
2019-08-14 08:02:30 +09:00
Seiichi Uchida
4871d6467a
Use the correct BytePos for the opening brace position ( #3742 )
2019-08-13 23:21:55 +09:00
Caleb Cartwright
ac150d016b
fix: remove trailing space with empty dyn macro arg ( #3737 )
2019-08-11 12:49:14 +09:00
topecongiro
0462008de8
Release 1.4.4
2019-08-06 11:14:12 +09:00
Seiichi Uchida
c0cb5eb535
Fix broken tuple pattern ( #3729 )
2019-08-06 11:09:45 +09:00
Caleb Cartwright
afc8fbd701
fix: issue with --all when workspace member also exists in dep tree ( #3726 )
2019-08-06 00:33:59 +09:00
topecongiro
3adfb08afe
Release 1.4.3
2019-08-03 00:01:59 +09:00
Igor Matuszewski
62a32e7b83
Fix most recenty nightly breakage due to removed await! support ( #3722 )
2019-08-02 23:54:39 +09:00
rChaser53
3b7a518144
fix underscore in slice patterns are removed ( #3719 )
2019-07-31 23:55:58 +09:00
topecongiro
aeb3496f31
Release v1.4.2
2019-07-31 11:10:49 +09:00
topecongiro
9e960e7d6a
Release v1.4.1
2019-07-30 14:39:07 +09:00
rChaser53
fe05e88831
fix to build with rustc 1.38.0-nightly ( 4560cb830
2019-07-28) ( #3712 )
2019-07-30 14:32:38 +09:00
topecongiro
365461349d
Release 1.4.0
2019-07-29 05:58:18 +09:00
Seiichi Uchida
983a92c872
Update rustc-ap-* crates to 541.0.0 ( #3707 )
2019-07-29 05:52:45 +09:00
Seiichi Uchida
b004329782
Simplify code around visit_fn ( #3698 )
2019-07-21 13:26:41 +09:00
Seiichi Uchida
c0e616bc1d
Implement closing-block procedure without relying on missed_span module ( #3691 )
2019-07-17 23:07:12 +09:00
Michele d'Amico
76e2ba25bd
#3665 : Implemented ( #3689 )
2019-07-17 09:40:33 +09:00
Seiichi Uchida
66c27c9161
Add #[ignore] to test that runs external process ( #3690 )
2019-07-16 19:36:23 +09:00
topecongiro
65931cd09d
Release 1.3.3
2019-07-15 22:47:10 +09:00
Seiichi Uchida
89940e541f
Fix bugs related to file-lines ( #3684 )
2019-07-15 22:41:56 +09:00
Stéphane Campinas
6487422b3e
fix print-config minimal option ( #3687 )
2019-07-15 20:58:54 +09:00
calebcartwright
6f67f07752
refactor: simplify manifest_path option checks
2019-07-14 09:56:07 -05:00
calebcartwright
aef8e93514
Merge remote-tracking branch 'upstream/master' into accept-manifest-path
2019-07-14 09:30:11 -05:00
rChaser53
71289e1d23
fix 'extra comma inserted due to comment' ( #3677 )
2019-07-14 22:16:47 +09:00
Eric Huss
e55fc6be3b
Fix using --help, --verbose, etc. ( #3620 )
2019-07-14 10:25:53 +09:00
Ruben Schmidmeister
37695b3c45
Extract configuration snippet tests into own module ( #3667 )
...
* Extract configuration snippet tests into own module
* Move helper function outside of test function
2019-07-14 10:22:18 +09:00
calebcartwright
17cbbd8cbc
feat: add --manifest-path support to cargo fmt
2019-07-12 20:59:29 -05:00
topecongiro
679c8d5f10
Release 1.3.2
2019-07-06 14:22:30 +09:00
Seiichi Uchida
3200af9785
Do not consider macro-origin await as chain item ( #3671 )
2019-07-06 14:17:53 +09:00
Caleb Cartwright
ff49b80628
fix: handling of --all when dep name and dir name differ ( #3664 )
2019-07-06 14:17:35 +09:00
topecongiro
44149d6ba4
Release 1.3.1
2019-06-30 13:20:32 +09:00
Stéphane Campinas
1f06a8b361
fix extraction of missing comments when rewriting an empty where clause ( #3663 )
2019-06-30 12:19:24 +09:00
calebcartwright
731f7d5200
fix: handling of associated type bounds
2019-06-28 16:15:42 -05:00
Nikhil Benesch
e0e2f0db53
Don't panic on license check errors ( #3655 )
...
Without this case, an ErrorKind::LicenseCheck results in a panic:
thread 'main' panicked at 'internal error: entered unreachable code', src/tools/rustfmt/src/formatting.rs:320:18
N.B.: errors of this type are only raised when the configuration file
contains `license_tempate_path = "TEMPLATE_FILE"`.
2019-06-26 10:51:11 +09:00
Caleb Cartwright
c955b5908e
fix: run in sub dirs/workspace member dirs ( #3652 )
2019-06-25 23:15:33 +09:00
rChaser53
9986b9d011
fix internal error for long closure types ( #3653 )
2019-06-25 23:14:19 +09:00
Nootan Ghimire
561653326d
Add newline after help text ( #3650 )
2019-06-25 11:44:14 +09:00
rChaser53
26d370e9e5
remove unreachable!() ( #3646 )
2019-06-23 16:24:40 +09:00
rChaser53
5b0ce0ed12
avoid not to truncate necessary chars ( #3640 )
2019-06-23 14:32:14 +09:00
Seiichi Uchida
1d19a08ed4
Format the last expression-statement as expression ( #3631 )
2019-06-17 08:53:39 +09:00
Stéphane Campinas
84c2356590
handle unicode chars in closures ( #3632 )
...
The `NotUnicode` branch was unecessarily put on a new line, although it
was within max width:
```diff
fn baz() {
let our_error_b = result_b_from_func.or_else(|e| match e {
NotPresent => Err(e).chain_err(|| "env var wasn't provided"),
- NotUnicode(_) => Err(e).chain_err(|| "env var was very very very borkæ–‡å—化ã"),
+ NotUnicode(_) => {
+ Err(e).chain_err(|| "env var was very very very borkæ–‡å—化ã")
+ }
});
}
```
2019-06-17 08:53:17 +09:00
Caleb Cartwright
944fc57e10
tests: ensure min number of system/idempotent tests ran ( #3629 )
2019-06-16 23:47:22 +09:00
Seiichi Uchida
a4eab17d7c
Fix is_subpath
2019-06-14 19:16:17 +09:00
Ruben Schmidmeister
dbac28b4b4
Use trait to abstract emit modes ( #3616 )
2019-06-13 06:59:20 +09:00
Stéphane Campinas
1cea171cef
Improve handling of unicode characters ( #3618 )
2019-06-12 20:28:29 +09:00
Stéphane Campinas
04add0cd38
implement Display for enums with attribute config_type ( #3621 )
2019-06-12 20:20:42 +09:00
topecongiro
d33450247b
Rename config_proc_macro to rustfmt-config_proc_macro
2019-06-09 22:29:36 +09:00
Seiichi Uchida
0e3cf08ff1
Release 1.3.0 ( #3611 )
2019-06-09 21:28:57 +09:00
Seiichi Uchida
47a11cd516
Format modules defined in cfg_attr ( #3604 )
2019-06-09 09:20:39 +09:00
Seiichi Uchida
e71bffb008
Format modules defined inside cfg_if macro calls ( #3600 )
2019-06-08 18:47:18 +09:00
Stéphane Campinas
87565c42ce
Merge pull request #3607 from topecongiro/issue-3493
...
Ignore sub-modules when skip-children is used
2019-06-08 09:50:12 +02:00
topecongiro
dae63e98ce
Ignore sub-modules when skip-children is used
2019-06-07 14:55:41 +09:00
rChaser53
5607178d0a
fix the bug add unwanted code to impl ( #3601 ) ( #3602 )
2019-06-06 13:06:40 +09:00
Stéphane Campinas
e0459eb3fe
inline the attribute with its item even with the macro_use attribute or when reorder_imports is disabled ( #3598 )
2019-06-05 00:14:12 +09:00
Seiichi Uchida
2244f326e6
Cargo update ( #3559 )
...
Update `rustc-ap-*` crates to 486.0.0.
2019-06-03 23:57:02 +09:00
Stéphane Campinas
e6b60a40d5
stabilise fn_args_density ( #3581 )
2019-06-03 22:26:48 +09:00
Stéphane Campinas
6d19a8c71d
Merge pull request #3586 from topecongiro/issue-3584
...
Format trait aliases with where clauses
2019-05-30 09:39:15 +02:00
rChaser53
fbd9f335f9
fix Erasing inner attributes in struct ( #3593 )
2019-05-30 07:31:48 +09:00
Stéphane Campinas
1c210eb3c6
Merge pull request #3589 from topecongiro/issue-3583
...
Catch panics from the parser while rewriting macro calls
2019-05-28 00:49:28 +02:00
topecongiro
36dd49ae5f
Set macro_rewrite_failure to true on catching panic
2019-05-28 00:15:14 +09:00
topecongiro
f7cd789ebc
Catch panics from the parser while rewriting macro calls
2019-05-28 00:03:50 +09:00
topecongiro
c1373b267b
Format trait aliases with where clauses
2019-05-26 21:15:55 +09:00
topecongiro
95c2ad37e1
Refactor rewrite_where_clause
2019-05-26 21:15:38 +09:00
Ivan Veselov
8443262781
Use structopt for rustfmt-format-diff arguments parsing
2019-05-23 22:59:26 +01:00
Seiichi Uchida
a7d4ec92cb
Implement Serialize on IgnoreList ( #3565 )
...
* Implement Serialize on IgnoreList
* Add a test for #3536
2019-05-22 09:41:57 +02:00
Seiichi Uchida
b5449ba785
Allow overflowing rhs of unit variant ( #3566 )
2019-05-22 10:51:19 +09:00
Seiichi Uchida
72ca0e5f2c
Merge pull request #3577 from topecongiro/issue-3575
...
Insert an empty line when normalizing `#[doc = ""]`
2019-05-22 10:49:12 +09:00
Seiichi Uchida
86dad6e3dd
Merge pull request #3576 from rchaser53/issue-3567
...
add the handling for vec! with paren inside macro
2019-05-22 07:00:07 +09:00
Ivan Veselov
a7afdeb9b8
Drop only the first occurrence of fmt
while preparing CLI arguments
2019-05-21 16:36:53 +01:00
Ivan Veselov
32fbe75a4c
Drop extra fmt
command line argument provided by cargo
2019-05-21 16:36:53 +01:00