]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agofix: don't drop leading comments in extern
Caleb Cartwright [Mon, 16 Nov 2020 18:39:26 +0000 (12:39 -0600)]
fix: don't drop leading comments in extern

3 years agometa: bump version to v1.4.26
Caleb Cartwright [Sat, 14 Nov 2020 04:33:57 +0000 (22:33 -0600)]
meta: bump version to v1.4.26

3 years agoci: restrict GHA workflow triggers on push
Caleb Cartwright [Sat, 14 Nov 2020 04:17:07 +0000 (22:17 -0600)]
ci: restrict GHA workflow triggers on push

3 years agotests: attributed comment-only blocks
Caleb Cartwright [Sat, 14 Nov 2020 03:42:37 +0000 (21:42 -0600)]
tests: attributed comment-only blocks

3 years agoFixed 'Incorrect comment indent inside if/else' issue. (#4459)
WhizSid [Thu, 15 Oct 2020 02:08:58 +0000 (07:38 +0530)]
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

3 years agoCorrectly create artificial span for formatting closure body
Ayaz Hafiz [Sat, 15 Aug 2020 20:34:06 +0000 (13:34 -0700)]
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

3 years agofixup! Correctly create artificial span for formatting closure body
Ayaz Hafiz [Sat, 15 Aug 2020 20:38:06 +0000 (13:38 -0700)]
fixup! Correctly create artificial span for formatting closure body

3 years agometa: release v1.4.25
Caleb Cartwright [Wed, 11 Nov 2020 02:18:22 +0000 (20:18 -0600)]
meta: release v1.4.25

3 years agofeat: don't insert semi in macro_rules arm body
Caleb Cartwright [Wed, 11 Nov 2020 02:07:42 +0000 (20:07 -0600)]
feat: don't insert semi in macro_rules arm body

3 years agometa: release v1.4.24
Caleb Cartwright [Fri, 6 Nov 2020 01:45:56 +0000 (19:45 -0600)]
meta: release v1.4.24

3 years agofix: remove ignored depr attribute which now errors
Caleb Cartwright [Fri, 6 Nov 2020 01:30:56 +0000 (19:30 -0600)]
fix: remove ignored depr attribute which now errors

3 years agofix: remove comment from cherry-pick that v1.x doesn't handle
Caleb Cartwright [Fri, 6 Nov 2020 01:24:51 +0000 (19:24 -0600)]
fix: remove comment from cherry-pick that v1.x doesn't handle

3 years agoDon't flatten a block containing a single macro call
Aaron Hill [Tue, 27 Oct 2020 22:52:02 +0000 (18:52 -0400)]
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!()`)

3 years agometa: bump rustfmt version to 1.4.23
Caleb Cartwright [Fri, 30 Oct 2020 05:37:08 +0000 (00:37 -0500)]
meta: bump rustfmt version to 1.4.23

3 years agoci: fix asset upload workflow
Caleb Cartwright [Fri, 30 Oct 2020 05:20:23 +0000 (00:20 -0500)]
ci: fix asset upload workflow

3 years agofeat: v2 support for nested tuples w/o spaces
Caleb Cartwright [Fri, 30 Oct 2020 05:03:03 +0000 (00:03 -0500)]
feat: v2 support for nested tuples w/o spaces

3 years agoAdd some basic tests for `try{}` expressions
Scott McMurray [Tue, 13 Oct 2020 04:43:04 +0000 (21:43 -0700)]
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.

3 years agotests: adjust some cherry-picekd tests
Caleb Cartwright [Fri, 30 Oct 2020 03:59:45 +0000 (22:59 -0500)]
tests: adjust some cherry-picekd tests

3 years agofix: resolve some parser related bugs
Caleb Cartwright [Sat, 26 Sep 2020 05:00:49 +0000 (00:00 -0500)]
fix: resolve some parser related bugs

3 years agotests: add test for panic on new_parser_from_file
Caleb Cartwright [Sat, 26 Sep 2020 05:01:21 +0000 (00:01 -0500)]
tests: add test for panic on new_parser_from_file

3 years agofix(parser): better unclosed delims handling
Caleb Cartwright [Fri, 30 Oct 2020 03:50:25 +0000 (22:50 -0500)]
fix(parser): better unclosed delims handling

3 years agodeps: bump rustc-ap to v686
Caleb Cartwright [Wed, 28 Oct 2020 01:58:52 +0000 (20:58 -0500)]
deps: bump rustc-ap to v686

3 years agoFix overriding license header bug (#4488)
Michael Müller [Sat, 24 Oct 2020 16:14:52 +0000 (18:14 +0200)]
Fix overriding license header bug (#4488)

* Override header to None when path len = 0

* Add regression test

* Ensure nightly

3 years agoPreserve comments in empty statements (#4180)
hafiz [Wed, 20 May 2020 15:39:34 +0000 (10:39 -0500)]
Preserve comments in empty statements (#4180)

* Preserve comments in empty statements

Closes #4018

* fixup! Preserve comments in empty statements

3 years agoCorrectly indent skipped-over code
Ayaz Hafiz [Wed, 26 Aug 2020 04:52:26 +0000 (23:52 -0500)]
Correctly indent skipped-over code

Closes #4398

3 years agodeps: bump rustc-ap to v684
Caleb Cartwright [Sat, 24 Oct 2020 04:10:14 +0000 (23:10 -0500)]
deps: bump rustc-ap to v684

3 years agofeat: add initial support for ConstBlock expressions
Caleb Cartwright [Tue, 20 Oct 2020 01:26:56 +0000 (20:26 -0500)]
feat: add initial support for ConstBlock expressions

3 years agodeps: update macro parsing
Caleb Cartwright [Tue, 20 Oct 2020 01:26:36 +0000 (20:26 -0500)]
deps: update macro parsing

3 years agodeps: bump rustc-ap to v683
Caleb Cartwright [Sat, 24 Oct 2020 04:00:13 +0000 (23:00 -0500)]
deps: bump rustc-ap to v683

3 years agoRelease v1.4.22
Caleb Cartwright [Sun, 4 Oct 2020 17:09:54 +0000 (12:09 -0500)]
Release v1.4.22

3 years agorefactor: move env/osstr imports to avoid warnings
Caleb Cartwright [Sun, 4 Oct 2020 17:06:43 +0000 (12:06 -0500)]
refactor: move env/osstr imports to avoid warnings

3 years agoUse rustfmt given by RUSTFMT env var (#4419)
David Tolnay [Wed, 16 Sep 2020 14:09:10 +0000 (07:09 -0700)]
Use rustfmt given by RUSTFMT env var (#4419)

3 years agofixup! Preserve and format type aliases in extern blocks
Ayaz Hafiz [Sun, 10 May 2020 17:11:36 +0000 (10:11 -0700)]
fixup! Preserve and format type aliases in extern blocks

3 years agofixup! Preserve and format type aliases in extern blocks
Ayaz Hafiz [Sun, 10 May 2020 17:06:23 +0000 (10:06 -0700)]
fixup! Preserve and format type aliases in extern blocks

3 years agofixup! Preserve and format type aliases in extern blocks
Ayaz Hafiz [Sat, 9 May 2020 23:01:42 +0000 (16:01 -0700)]
fixup! Preserve and format type aliases in extern blocks

3 years agoPreserve and format type aliases in extern blocks
Ayaz Hafiz [Sat, 9 May 2020 22:19:48 +0000 (15:19 -0700)]
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.

3 years agoci: backport GHA workflows
Caleb Cartwright [Thu, 24 Sep 2020 03:22:37 +0000 (22:22 -0500)]
ci: backport GHA workflows

3 years agofeat: support config. of leading match arm pipe
Caleb Cartwright [Thu, 24 Sep 2020 03:19:11 +0000 (22:19 -0500)]
feat: support config. of leading match arm pipe

3 years agodocs: add config info for match_arm_leading_pipes
Caleb Cartwright [Thu, 24 Sep 2020 03:05:56 +0000 (22:05 -0500)]
docs: add config info for match_arm_leading_pipes

3 years agotests: add tests for leading pipe config
Caleb Cartwright [Thu, 24 Sep 2020 03:05:31 +0000 (22:05 -0500)]
tests: add tests for leading pipe config

3 years agoAdd regression test for unsafe mods
David Tolnay [Wed, 23 Sep 2020 04:24:23 +0000 (00:24 -0400)]
Add regression test for unsafe mods

3 years agodeps: bump rustc-ap to v679
David Tolnay [Wed, 23 Sep 2020 02:22:38 +0000 (22:22 -0400)]
deps: bump rustc-ap to v679

3 years agodeps: bump rustc-ap to v678
Caleb Cartwright [Wed, 16 Sep 2020 13:37:14 +0000 (08:37 -0500)]
deps: bump rustc-ap to v678

3 years agobump rustfmt version to v1.4.21
Caleb Cartwright [Fri, 4 Sep 2020 21:46:45 +0000 (16:46 -0500)]
bump rustfmt version to v1.4.21

3 years agofix: inner attribute formatting
Caleb Cartwright [Wed, 2 Sep 2020 23:42:00 +0000 (18:42 -0500)]
fix: inner attribute formatting

3 years agoFix module resolution in inner modules with paths (#4194)
mahkoh [Fri, 22 May 2020 09:55:34 +0000 (11:55 +0200)]
Fix module resolution in inner modules with paths (#4194)

3 years agochore: run rustfmt
Caleb Cartwright [Wed, 2 Sep 2020 17:59:58 +0000 (12:59 -0500)]
chore: run rustfmt

3 years agodeps: bump rustc-ap to v677
Caleb Cartwright [Wed, 2 Sep 2020 17:58:18 +0000 (12:58 -0500)]
deps: bump rustc-ap to v677

3 years agodeps: bump rustc-ap to v673
Caleb Cartwright [Wed, 2 Sep 2020 17:36:50 +0000 (12:36 -0500)]
deps: bump rustc-ap to v673

3 years agodeps: bump rustc-ap to v672
Caleb Cartwright [Wed, 2 Sep 2020 15:14:23 +0000 (10:14 -0500)]
deps: bump rustc-ap to v672

3 years agotests: add system tests for inverted span issue
Caleb Cartwright [Sun, 9 Aug 2020 19:00:26 +0000 (14:00 -0500)]
tests: add system tests for inverted span issue

3 years agofix: inverted span on attrs within closure
Caleb Cartwright [Sun, 9 Aug 2020 18:59:52 +0000 (13:59 -0500)]
fix: inverted span on attrs within closure

3 years agodeps: bump rustc-ap to v671 (#4356)
Caleb Cartwright [Fri, 7 Aug 2020 00:22:20 +0000 (19:22 -0500)]
deps: bump rustc-ap to v671 (#4356)

3 years agopreparation for potential rustfmt 1.4.19 (#4283)
Seiichi Uchida [Tue, 21 Jul 2020 02:51:49 +0000 (11:51 +0900)]
preparation for potential rustfmt 1.4.19 (#4283)

3 years agochore: backport 8157a3f0afe978d3e953420577f8344db7e905bf
Caleb Cartwright [Wed, 15 Jul 2020 14:19:21 +0000 (09:19 -0500)]
chore: backport 8157a3f0afe978d3e953420577f8344db7e905bf

3 years agodeps: bump rustc-ap to v669
Caleb Cartwright [Wed, 15 Jul 2020 02:36:24 +0000 (21:36 -0500)]
deps: bump rustc-ap to v669

3 years agodeps: bump rustc-ap-* to v668
Caleb Cartwright [Fri, 10 Jul 2020 04:15:08 +0000 (23:15 -0500)]
deps: bump rustc-ap-* to v668

4 years agodeps: bump rustc-ap* to v666
Caleb Cartwright [Sat, 27 Jun 2020 18:15:54 +0000 (13:15 -0500)]
deps: bump rustc-ap* to v666

4 years agoUse correct span for match arms with the leading pipe and attributes (#3975)
Seiichi Uchida [Sat, 21 Dec 2019 15:31:59 +0000 (00:31 +0900)]
Use correct span for match arms with the leading pipe and attributes (#3975)

4 years agoRelease v1.4.18
topecongiro [Sat, 13 Jun 2020 00:46:28 +0000 (09:46 +0900)]
Release v1.4.18

4 years agoMerge pull request #4253 from calebcartwright/rustfmt-1.4.18
Seiichi Uchida [Sat, 13 Jun 2020 00:28:25 +0000 (09:28 +0900)]
Merge pull request #4253 from calebcartwright/rustfmt-1.4.18

bump rustfmt 1.x rustc-ap* crates to v644

4 years agofix: backport fix for #4079
Caleb Cartwright [Fri, 12 Jun 2020 04:29:51 +0000 (23:29 -0500)]
fix: backport fix for #4079

4 years agofix: backport fix for #4020
Caleb Cartwright [Fri, 12 Jun 2020 04:17:38 +0000 (23:17 -0500)]
fix: backport fix for #4020

4 years agodeps: bump structopt (and proc-macro-error)
Caleb Cartwright [Fri, 12 Jun 2020 04:05:46 +0000 (23:05 -0500)]
deps: bump structopt (and proc-macro-error)

4 years agofix: backport fix for submod parser errors
Caleb Cartwright [Fri, 12 Jun 2020 02:49:40 +0000 (21:49 -0500)]
fix: backport fix for submod parser errors

4 years agofix: backport mod resolution error handling
Caleb Cartwright [Fri, 12 Jun 2020 02:11:18 +0000 (21:11 -0500)]
fix: backport mod resolution error handling

4 years agoSwitch to std::error::Error for errors (#3948)
David Tolnay [Tue, 3 Dec 2019 00:20:17 +0000 (16:20 -0800)]
Switch to std::error::Error for errors (#3948)

4 years agodeps: apply upstream rustc-* changes
Caleb Cartwright [Thu, 11 Jun 2020 18:22:37 +0000 (13:22 -0500)]
deps: apply upstream rustc-* changes

4 years agodeps: bump rustc-ap* to v664
Caleb Cartwright [Thu, 11 Jun 2020 18:21:55 +0000 (13:21 -0500)]
deps: bump rustc-ap* to v664

4 years agoRelease v1.4.17
topecongiro [Mon, 8 Jun 2020 01:48:46 +0000 (10:48 +0900)]
Release v1.4.17

4 years agoBump parking_lot
topecongiro [Mon, 8 Jun 2020 01:46:38 +0000 (10:46 +0900)]
Bump parking_lot

4 years agoSupport module-level rustfmt::skip in sub-modules
topecongiro [Mon, 8 Jun 2020 01:31:25 +0000 (10:31 +0900)]
Support module-level rustfmt::skip in sub-modules

4 years agoRelease v1.4.15
topecongiro [Tue, 19 May 2020 08:30:50 +0000 (17:30 +0900)]
Release v1.4.15

4 years agoCargo update
topecongiro [Tue, 19 May 2020 08:32:51 +0000 (17:32 +0900)]
Cargo update

4 years agoUpdate rustc-ap-* crates to 659.0.0 for rustfmt-1.4.15 (#4184)
Seiichi Uchida [Tue, 19 May 2020 08:31:28 +0000 (17:31 +0900)]
Update rustc-ap-* crates to 659.0.0 for rustfmt-1.4.15 (#4184)

4 years agoRelease v1.4.14
topecongiro [Tue, 14 Apr 2020 09:11:22 +0000 (18:11 +0900)]
Release v1.4.14

4 years agoBump rustc-ap* crates to 654.0.0 (#4121)
Seiichi Uchida [Tue, 14 Apr 2020 09:13:30 +0000 (18:13 +0900)]
Bump rustc-ap* crates to 654.0.0 (#4121)

4 years agofix: formatting arbitrary extern abi (#4089)
Caleb Cartwright [Tue, 31 Mar 2020 06:30:26 +0000 (01:30 -0500)]
fix: formatting arbitrary extern abi (#4089)

4 years agobackport new syntax to rustfmt 1.x (#4105)
Caleb Cartwright [Tue, 31 Mar 2020 06:28:01 +0000 (01:28 -0500)]
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

4 years agoMerge pull request #4100 from calebcartwright/rustfmt1x-rustc-v650
Manish Goregaokar [Mon, 30 Mar 2020 19:36:28 +0000 (12:36 -0700)]
Merge pull request #4100 from calebcartwright/rustfmt1x-rustc-v650

bump rustfmt 1x to rustc-ap v651

4 years agorefactor: use ast::attr:HasAttrs
Caleb Cartwright [Mon, 30 Mar 2020 18:11:00 +0000 (13:11 -0500)]
refactor: use ast::attr:HasAttrs

4 years agodeps: bump rustc-ap* to v651
Caleb Cartwright [Mon, 30 Mar 2020 17:02:39 +0000 (12:02 -0500)]
deps: bump rustc-ap* to v651

4 years agorefactor: rename libsyntax --> rustc_ast
Caleb Cartwright [Sat, 28 Mar 2020 03:29:12 +0000 (22:29 -0500)]
refactor: rename libsyntax --> rustc_ast

4 years agofix: unreachable err on Fn with `None` block
Caleb Cartwright [Sat, 28 Mar 2020 03:13:46 +0000 (22:13 -0500)]
fix: unreachable err on Fn with `None` block

4 years agofix: use correct ForeignItem span
Caleb Cartwright [Sat, 28 Mar 2020 03:00:00 +0000 (22:00 -0500)]
fix: use correct ForeignItem span

4 years agochore: fix src formatting
Caleb Cartwright [Sat, 28 Mar 2020 02:47:03 +0000 (21:47 -0500)]
chore: fix src formatting

4 years agorefactor: parse & mod resolver for rustc-ap v650
Caleb Cartwright [Fri, 27 Mar 2020 04:18:16 +0000 (23:18 -0500)]
refactor: parse & mod resolver for rustc-ap v650

4 years agorefactor: backport syntux mod
Caleb Cartwright [Fri, 27 Mar 2020 02:25:34 +0000 (21:25 -0500)]
refactor: backport syntux mod

4 years agodeps: bump to rustc v647
Caleb Cartwright [Thu, 26 Mar 2020 22:20:24 +0000 (17:20 -0500)]
deps: bump to rustc v647

4 years agodeps: bump to rustc v644
Caleb Cartwright [Thu, 26 Mar 2020 20:26:58 +0000 (15:26 -0500)]
deps: bump to rustc v644

4 years agorustfmt 1.x bump rustc-ap to v642 (#4043)
Seiichi Uchida [Mon, 10 Feb 2020 04:42:10 +0000 (13:42 +0900)]
rustfmt 1.x bump rustc-ap to v642 (#4043)

4 years agochore: fix compile warnings
Caleb Cartwright [Sun, 9 Feb 2020 04:54:37 +0000 (22:54 -0600)]
chore: fix compile warnings

4 years agofix: backport parse bug fix
Caleb Cartwright [Sun, 9 Feb 2020 04:47:48 +0000 (22:47 -0600)]
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.

4 years agodeps: update rustc-ap to v642.0.0
Caleb Cartwright [Sun, 9 Feb 2020 04:21:37 +0000 (22:21 -0600)]
deps: update rustc-ap to v642.0.0

4 years agoRelease v1.4.11
topecongiro [Mon, 2 Dec 2019 23:49:39 +0000 (08:49 +0900)]
Release v1.4.11

4 years agoDo not add block around async closure (#3946)
Seiichi Uchida [Mon, 2 Dec 2019 23:47:50 +0000 (08:47 +0900)]
Do not add block around async closure (#3946)

4 years agoRelease v1.4.10
topecongiro [Fri, 25 Oct 2019 06:21:44 +0000 (15:21 +0900)]
Release v1.4.10

4 years agoCargo update
topecongiro [Fri, 25 Oct 2019 06:17:33 +0000 (15:17 +0900)]
Cargo update

4 years agoReturn an error if `--check` or `--emit json` are used with stdin. (#3875)
Chris Emerson [Fri, 25 Oct 2019 06:05:24 +0000 (07:05 +0100)]
Return an error if `--check` or `--emit json` are used with stdin. (#3875)

4 years agofix handling of nested comments in patterns and ControlFlows (#3869)
Seiichi Uchida [Fri, 25 Oct 2019 06:04:33 +0000 (15:04 +0900)]
fix handling of nested comments in patterns and ControlFlows (#3869)