Commit Graph

4939 Commits

Author SHA1 Message Date
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
ea97ec5a4e meta: bump rustfmt version to 1.4.23 2020-11-02 19:19:21 -06:00
Caleb Cartwright
fb517f45c6 ci: fix asset upload workflow 2020-11-02 18:31:51 -06:00
Caleb Cartwright
15854e5fd3 feat: v2 support for nested tuples w/o spaces 2020-11-02 18:31:51 -06:00
Scott McMurray
278e8da33b Add some basic tests for try{} expressions
They failed to parse in rustfmt on me in https://github.com/rust-lang/rust/pull/77877, which looks like it's since been fixed, but I figured I'd send in some tests anyway.
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
2866634baf deps: bump rustc-ap to v684 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
Caleb Cartwright
d95a2875f7 deps: bump rustc-ap to v683 2020-10-24 11:13:00 -05:00
Caleb Cartwright
97d0301011 Release v1.4.22 2020-10-04 16:58:34 -05:00
Caleb Cartwright
bdb1c44986 refactor: move env/osstr imports to avoid warnings 2020-10-04 16:58:34 -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
8eedd82317 ci: backport GHA workflows 2020-09-24 09:43:31 -05:00
Caleb Cartwright
d6a220b70a feat: support config. of leading match arm pipe 2020-09-24 09:43:31 -05:00
Caleb Cartwright
f6b96254fb docs: add config info for match_arm_leading_pipes 2020-09-24 09:43:31 -05:00
Caleb Cartwright
4908ee19c3 tests: add tests for leading pipe config 2020-09-24 09:43:31 -05:00
David Tolnay
146578c480 Add regression test for unsafe mods 2020-09-23 00:45:18 -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
01f2eadccc bump rustfmt version to v1.4.21 2020-09-04 19:01: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
d00849e226 deps: bump rustc-ap to v677 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
48f6c32ec1 tests: add system tests for inverted span issue 2020-08-09 14:32:34 -05:00
Caleb Cartwright
a17803127f fix: inverted span on attrs within closure 2020-08-09 14:32:34 -05:00
Caleb Cartwright
a88f0288b3
deps: bump rustc-ap to v671 (#4356) 2020-08-06 19:22:20 -05:00
Seiichi Uchida
cef1c0d5eb
preparation for potential rustfmt 1.4.19 (#4283) 2020-07-21 11:51:49 +09: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
topecongiro
c1e9b7b874
Release v1.4.18 2020-06-13 09:46:28 +09:00
Seiichi Uchida
4d36560b15
Merge pull request #4253 from calebcartwright/rustfmt-1.4.18
bump rustfmt 1.x rustc-ap* crates to v644
2020-06-13 09:28:25 +09:00