]>
git.lizzy.rs Git - rust.git/log
Seiichi Uchida [Sat, 29 Sep 2018 22:10:31 +0000 (07:10 +0900)]
Avoid using to_expr as much as possible
Seiichi Uchida [Sat, 29 Sep 2018 15:26:36 +0000 (00:26 +0900)]
Get rid of ToExpr trait
Seiichi Uchida [Sat, 29 Sep 2018 05:33:00 +0000 (14:33 +0900)]
Take impl Iterator for overflow routines
Otavio Salvador [Thu, 27 Sep 2018 19:45:22 +0000 (16:45 -0300)]
comment: Add documentation to `is_doc_comment` public method
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Nick Cameron [Fri, 28 Sep 2018 09:54:29 +0000 (21:54 +1200)]
Merge pull request #3061 from mehcode/feature/default-edition
Fix help message for edition config option
Nick Cameron [Fri, 28 Sep 2018 09:48:57 +0000 (21:48 +1200)]
Merge pull request #2816 from moxian/enum-discrim
Add option to vertically align enum discriminants.
Ryan Leckey [Fri, 28 Sep 2018 05:31:17 +0000 (22:31 -0700)]
Fix help message for edition config option
Seiichi Uchida [Fri, 28 Sep 2018 02:10:58 +0000 (11:10 +0900)]
Merge pull request #3050 from andrehjr/empty-impl-body-with-braces-newline
Trait Implementation - Adds a newline before the last brace on impls without a body if the first brace is also on a newline
Seiichi Uchida [Fri, 28 Sep 2018 02:08:51 +0000 (11:08 +0900)]
Merge pull request #3052 from scampi/contributing
added a note about the use of the RUST_LOG environment variable
Stéphane Campinas [Fri, 28 Sep 2018 02:06:29 +0000 (04:06 +0200)]
do not format a code block in documentation if it is annotated with ignore or text (#3058)
Stéphane Campinas [Wed, 26 Sep 2018 20:41:31 +0000 (22:41 +0200)]
added a note about the use of the RUST_LOG environment variable
moxian [Wed, 26 Sep 2018 18:29:26 +0000 (18:29 +0000)]
Change enum align semantics to care about absolute length, rather than difference.
If we're only aligning enum discriminants that are "not too far apart
(length-wise)", then this works really well for enums with
consistently-long or consistently-short idents, but not for the mixed
ones.
However, consistently-long idents is somewhate of an uncommon case and
overlong idents may be allowed to be formatted suboptimally if that
makes mixed-length idents work better (and it does in this case).
moxian [Fri, 29 Jun 2018 06:47:51 +0000 (06:47 +0000)]
Add option to vertically align enum discriminants.
André Luis Leal Cardoso Junior [Tue, 25 Sep 2018 11:53:42 +0000 (08:53 -0300)]
Makes brace behavior consistent with empty bodies for traits and impls
Adds a newline before the last brace on impls without a body if the first brace is also on a newline
Nick Cameron [Tue, 25 Sep 2018 20:55:15 +0000 (08:55 +1200)]
Update rustc_ap_syntax
Nick Cameron [Tue, 25 Sep 2018 06:23:17 +0000 (18:23 +1200)]
Remove unnecessary feature flag
Nick Cameron [Mon, 24 Sep 2018 02:22:01 +0000 (14:22 +1200)]
Merge pull request #3048 from emilio/merged-comments
lists: Detect block comment by starting from the end.
Nick Cameron [Mon, 24 Sep 2018 02:11:46 +0000 (14:11 +1200)]
Merge pull request #3045 from scampi/issue2917
Prevent right-shifting of block comments with bare lines.
Nick Cameron [Mon, 24 Sep 2018 02:07:20 +0000 (14:07 +1200)]
Merge pull request #3044 from orium/fix-too-many-modsep
Fix bug in import where two consecutive module separators were possible.
Emilio Cobos Álvarez [Sat, 22 Sep 2018 10:03:33 +0000 (12:03 +0200)]
lists: Detect block comment by starting from the end.
The issue with the current code is that comments are collapsed, so comments like
the one from the test end up in a string like:
```
"// this is a single line comment\n/* block = */"
```
I chose to fix it by detecting whether we're in a block comment starting from
the end instead, and tested a single-line comment ended in `*/` just for sanity,
ensuring line breaks are not removed in that case, which would break the
formatting.
The right fix eventually is probably to lex the comments properly, but this does
the work for now, I guess :)
Fixes #3025
Stéphane Campinas [Fri, 21 Sep 2018 22:09:11 +0000 (00:09 +0200)]
Prevent right-shifting of block comments with bare lines.
Lines that didn't start with a comment sigil were returned unchanged in
comment::rewrite_comment. Then these unchanged lines were indented in
MacroBranch::rewrite.
Diogo Sousa [Fri, 21 Sep 2018 17:46:35 +0000 (18:46 +0100)]
Fix bug in import where two consecutive module separators were possible.
Fixes #3043.
Nick Cameron [Fri, 21 Sep 2018 02:25:21 +0000 (14:25 +1200)]
Merge pull request #3042 from topecongiro/issue-3040
Do not trim a block from expression if its condition will go multi-line
Seiichi Uchida [Thu, 20 Sep 2018 15:58:47 +0000 (00:58 +0900)]
Do not trim a block from expression if its condition will go multi-line
Seiichi Uchida [Thu, 20 Sep 2018 15:57:46 +0000 (00:57 +0900)]
Add a test for #3040
Nick Cameron [Wed, 19 Sep 2018 23:36:46 +0000 (11:36 +1200)]
Merge pull request #3036 from topecongiro/issue-2932
Combine chain items only when the item gets orphaned otherwise
Nick Cameron [Wed, 19 Sep 2018 23:33:47 +0000 (11:33 +1200)]
Merge pull request #3035 from topecongiro/issue-3006
Format generics on associated types
Seiichi Uchida [Wed, 19 Sep 2018 14:22:26 +0000 (23:22 +0900)]
Cargo fmt
Seiichi Uchida [Wed, 19 Sep 2018 14:21:07 +0000 (23:21 +0900)]
Fix shape for index
Seiichi Uchida [Wed, 19 Sep 2018 14:20:43 +0000 (23:20 +0900)]
Combine chain items only when the item will get orphaned
Seiichi Uchida [Wed, 19 Sep 2018 14:19:24 +0000 (23:19 +0900)]
Update tests
Seiichi Uchida [Wed, 19 Sep 2018 13:33:10 +0000 (22:33 +0900)]
Format generics on associated types
Seiichi Uchida [Wed, 19 Sep 2018 13:20:42 +0000 (22:20 +0900)]
Add a test for #3006
Nick Cameron [Tue, 18 Sep 2018 23:31:28 +0000 (11:31 +1200)]
Merge pull request #3028 from scampi/issue2973
Fix indent computation of a macro with braces.
Nick Cameron [Tue, 18 Sep 2018 23:05:27 +0000 (11:05 +1200)]
Merge pull request #3002 from lqd/normalize-doc-attributes
normalize_doc_attributes option: convert doc attributes to comments
Nick Cameron [Tue, 18 Sep 2018 22:43:21 +0000 (10:43 +1200)]
Merge pull request #3001 from scampi/issue2977
propagate errors about failing to rewrite a macro
Nick Cameron [Tue, 18 Sep 2018 22:42:16 +0000 (10:42 +1200)]
Merge pull request #3014 from PSeitz/master
fixes #2914 by handling BadIssue case
Seiichi Uchida [Tue, 18 Sep 2018 11:21:21 +0000 (20:21 +0900)]
Merge pull request #3013 from YaLTeR/fix-issue-2985
Fix wrong shape for last chain items for indent_style = "Visual"
Nathan Sutton [Tue, 18 Sep 2018 11:20:07 +0000 (06:20 -0500)]
Improve error message when failing cargo metadata (#3024)
Seiichi Uchida [Tue, 18 Sep 2018 11:18:24 +0000 (20:18 +0900)]
Merge pull request #3019 from yangby-cryptape/fix-typo-in-readme
Fix typo in README.md.
Seiichi Uchida [Tue, 18 Sep 2018 11:17:59 +0000 (20:17 +0900)]
Merge pull request #3017 from matthiaskrgr/typo
cargo fmt: fix typo in format_crate(): (verison -> version)
Nick Cameron [Tue, 18 Sep 2018 09:12:12 +0000 (21:12 +1200)]
Merge pull request #3012 from YaLTeR/fix-issue-2496
Fix match arm block flattening
Stéphane Campinas [Mon, 17 Sep 2018 21:17:36 +0000 (23:17 +0200)]
Fix indent computation of a macro with braces.
The leading whitespace of a multine string was taken into account when
computing the `min_prefix_space_width`, even if that line couldn't be
trimmed. The consequence is it was always shifting the macro's content
to the right.
Boyu Yang [Thu, 13 Sep 2018 02:01:34 +0000 (10:01 +0800)]
Fix typo in README.md.
Rémy Rakic [Thu, 13 Sep 2018 00:40:24 +0000 (02:40 +0200)]
add test ensuring only doc = "" attributes are normalized to comments
The other shapes of doc attributes shouldn't be normalized or modified.
Rémy Rakic [Thu, 13 Sep 2018 00:27:09 +0000 (02:27 +0200)]
add tests interleaving doc attrib comments and regular comments
Rémy Rakic [Wed, 12 Sep 2018 23:13:07 +0000 (01:13 +0200)]
address review comment in Attribute rewrite fn
Rémy Rakic [Wed, 12 Sep 2018 23:10:57 +0000 (01:10 +0200)]
add non-regression test to existing attributes
when `normalize_doc_attributes` is on, they shouldn't be affected
Rémy Rakic [Wed, 12 Sep 2018 23:06:02 +0000 (01:06 +0200)]
add non-regression test to existing doc attributes
when `normalize_doc_attributes` is off, they shouldn't be normalized to a doc comment
Rémy Rakic [Wed, 12 Sep 2018 23:02:11 +0000 (01:02 +0200)]
add test with multiple levels of indents
Rémy Rakic [Wed, 12 Sep 2018 22:37:31 +0000 (00:37 +0200)]
move config attribute
Matthias Krüger [Wed, 12 Sep 2018 19:43:31 +0000 (21:43 +0200)]
cargo fmt: fix typo in format_crate(): (verison -> version)
Stéphane Campinas [Wed, 12 Sep 2018 11:09:07 +0000 (13:09 +0200)]
implement Drop from FmtVisitor in order to simplify failures passing
Nick Cameron [Wed, 12 Sep 2018 03:33:18 +0000 (15:33 +1200)]
Merge pull request #3000 from dimbleby/dch/typo
Fix typo in usage text
Nick Cameron [Wed, 12 Sep 2018 03:32:27 +0000 (15:32 +1200)]
Merge pull request #2998 from ReapOmen/fix-rustfmt-diff-output
Change `print_diff` to output the correct line number.
Nick Cameron [Wed, 12 Sep 2018 01:55:41 +0000 (13:55 +1200)]
Merge pull request #3010 from topecongiro/issue-3009
Refactor the corner case of handling long function
Nick Cameron [Wed, 12 Sep 2018 01:55:06 +0000 (13:55 +1200)]
Merge pull request #3011 from topecongiro/rustc-ap-syntax
Cargo update
Nick Cameron [Wed, 12 Sep 2018 01:54:23 +0000 (13:54 +1200)]
Merge pull request #3015 from YaLTeR/fix-fn-type-comma
Fix extra new line in fn type aliases with indent_style = "Visual"
Ivan Molodetskikh [Tue, 11 Sep 2018 09:34:33 +0000 (12:34 +0300)]
Don't insert a new line when fn has no return type
Ivan Molodetskikh [Tue, 11 Sep 2018 09:34:21 +0000 (12:34 +0300)]
Add a visual fn type alias test
Pascal Seitz [Tue, 11 Sep 2018 08:46:39 +0000 (10:46 +0200)]
fixes #2914 by handling BadIssue case
Ivan Molodetskikh [Tue, 11 Sep 2018 08:08:28 +0000 (11:08 +0300)]
Fix last chain item shape for Visual indent_style
Ivan Molodetskikh [Tue, 11 Sep 2018 08:09:17 +0000 (11:09 +0300)]
Add a test for #2985
Ivan Molodetskikh [Tue, 11 Sep 2018 05:41:16 +0000 (08:41 +0300)]
Use correct heuristic for match block flattening
Ivan Molodetskikh [Tue, 11 Sep 2018 05:31:35 +0000 (08:31 +0300)]
Add a test for match flattening
Ivan Molodetskikh [Fri, 31 Aug 2018 14:51:36 +0000 (17:51 +0300)]
Add a test for #2496
Seiichi Uchida [Tue, 11 Sep 2018 04:52:46 +0000 (13:52 +0900)]
Cargo update
Seiichi Uchida [Tue, 11 Sep 2018 04:31:37 +0000 (13:31 +0900)]
Refactor the corner case of handling long function
Seiichi Uchida [Tue, 11 Sep 2018 04:30:36 +0000 (13:30 +0900)]
Add a test for #3009
Nick Cameron [Tue, 11 Sep 2018 03:50:13 +0000 (15:50 +1200)]
Merge pull request #2988 from YaLTeR/fix-issue-2922
Use correct indent in rewrite_bare_fn with Visual style
Nick Cameron [Sun, 9 Sep 2018 21:50:49 +0000 (09:50 +1200)]
Merge pull request #3007 from alexcrichton/wasm
Support platforms without a timer
Alex Crichton [Sun, 9 Sep 2018 18:12:13 +0000 (11:12 -0700)]
Support platforms without a timer
I've dabbled recently in seeing how hard it would be to compile rustfmt to wasm
and then run it in a web browser, and it turns out that it's [not too
hard][wasm]! In addition to patching a few dependencies which already have a
number of patches out rustfmt also needed some modifications to get it to work,
namely avoiding the usage of `Instant::now()` on the "happy path" which doesn't
work on wasm (it just panics).
This commit is an attempt to add a support for this by avoiding using
`Instant::now()` on the wasm target, but panicking if the actual time elapsed is
requested (which doesn't happen unless verbosely logging I believe).
[wasm]: https://alexcrichton.github.io/rustfmt-wasm/
lqd [Fri, 7 Sep 2018 17:51:21 +0000 (19:51 +0200)]
normalize_doc_attributes option: convert doc attributes to comments
Convert `#![doc]` and `#[doc]` attributes to `//!` and `///` doc comments.
Stéphane Campinas [Fri, 7 Sep 2018 12:48:52 +0000 (14:48 +0200)]
propagate errors about failing to rewrite a macro
David Hotham [Fri, 7 Sep 2018 08:01:44 +0000 (09:01 +0100)]
Fix typo in usage text
Robert Bartlensky [Thu, 6 Sep 2018 16:16:48 +0000 (17:16 +0100)]
Change `print_diff` to output the correct line number.
Nick Cameron [Thu, 6 Sep 2018 05:40:08 +0000 (17:40 +1200)]
Merge pull request #2997 from matthiaskrgr/cargo_test_release
fix cargo test --release
Matthias Krüger [Thu, 6 Sep 2018 00:07:09 +0000 (02:07 +0200)]
fix cargo test --release.
test::verify_check_works was failing in relase mode on my machine.
The problem was it would check for target/debug/rustfmt in release mode instead of
target/release/rustfmt and fail an assert.
This commit fixes it so that cargo check looks for target/debug/rustfmt and
cargo check --release looks for target/release/rustfmt
Nick Cameron [Tue, 4 Sep 2018 07:11:49 +0000 (19:11 +1200)]
Merge pull request #2983 from topecongiro/issue-2642
Handle raw string literals in CharClasses
Nick Cameron [Tue, 4 Sep 2018 07:11:23 +0000 (19:11 +1200)]
Merge pull request #2993 from topecongiro/rustc-ap
Cargo update
topecongiro [Fri, 31 Aug 2018 05:21:02 +0000 (14:21 +0900)]
Cargo update
Nick Cameron [Mon, 3 Sep 2018 01:25:35 +0000 (13:25 +1200)]
Merge pull request #2992 from max-sixty/clippy2
Clippy 2/2
Nick Cameron [Mon, 3 Sep 2018 01:10:50 +0000 (13:10 +1200)]
Merge pull request #2986 from topecongiro/issue-2907
Handle chain w/ try operators with spaces
Nick Cameron [Mon, 3 Sep 2018 01:08:19 +0000 (13:08 +1200)]
Merge pull request #2991 from topecongiro/raw-identifier-in-chain
Handle raw identifiers in chain
Maximilian Roos [Sat, 1 Sep 2018 20:26:47 +0000 (16:26 -0400)]
final clippy changes
Seiichi Uchida [Sat, 1 Sep 2018 07:18:27 +0000 (16:18 +0900)]
Handle raw identifiers in chain
Seiichi Uchida [Sat, 1 Sep 2018 07:04:14 +0000 (16:04 +0900)]
Merge pull request #2987 from YaLTeR/fix-issue-2930
Use correct shape in Visual tuple rewriting
Ivan Molodetskikh [Fri, 31 Aug 2018 13:53:18 +0000 (16:53 +0300)]
Use correct fn args indent for Visual
Ivan Molodetskikh [Fri, 31 Aug 2018 13:52:45 +0000 (16:52 +0300)]
Add debug logging to fn-related functions
Ivan Molodetskikh [Fri, 31 Aug 2018 13:01:38 +0000 (16:01 +0300)]
Add a test for #2922
Ivan Molodetskikh [Fri, 31 Aug 2018 12:50:41 +0000 (15:50 +0300)]
Fix shape in rewrite_tuple_in_visual_indent_style
Ivan Molodetskikh [Fri, 31 Aug 2018 12:25:08 +0000 (15:25 +0300)]
Add a test for #2930
Seiichi Uchida [Fri, 31 Aug 2018 09:26:19 +0000 (18:26 +0900)]
Merge pull request #2984 from mehcode/feature/edition-option
Accept 2015 and 2018 instead of Edition2015 and Edition2018 for edition option
Seiichi Uchida [Fri, 31 Aug 2018 09:19:34 +0000 (18:19 +0900)]
Update tests
Seiichi Uchida [Fri, 31 Aug 2018 09:19:13 +0000 (18:19 +0900)]
Simplify post-comment extraction
Seiichi Uchida [Fri, 31 Aug 2018 09:16:50 +0000 (18:16 +0900)]
Use trim_tries to extract post comment over simple trim_matches
Seiichi Uchida [Fri, 31 Aug 2018 09:11:59 +0000 (18:11 +0900)]
Use trim_tries to extract pre-comments over simple trim_matches
Seiichi Uchida [Fri, 31 Aug 2018 09:11:52 +0000 (18:11 +0900)]
Add trim_tries
Seiichi Uchida [Fri, 31 Aug 2018 09:10:47 +0000 (18:10 +0900)]
Add a test for #2907
Ryan Leckey [Fri, 31 Aug 2018 07:04:23 +0000 (00:04 -0700)]
Accept 2015 and 2018 instead of Edition2015 and Edition2018 for edition option