Commit Graph

4222 Commits

Author SHA1 Message Date
Ivan Molodetskikh
abcdc0fadd
Add a test for #2985 2018-09-11 11:09:31 +03:00
Ivan Molodetskikh
838df8dfb6
Use correct heuristic for match block flattening 2018-09-11 08:54:43 +03:00
Ivan Molodetskikh
f116baeed7
Add a test for match flattening 2018-09-11 08:54:43 +03:00
Ivan Molodetskikh
bc03234e25
Add a test for #2496 2018-09-11 08:54:43 +03:00
Seiichi Uchida
e06f16a0a5 Cargo update 2018-09-11 13:52:46 +09:00
Seiichi Uchida
d8357484ac Refactor the corner case of handling long function 2018-09-11 13:31:37 +09:00
Seiichi Uchida
9674e12a5c Add a test for #3009 2018-09-11 13:30:36 +09:00
Nick Cameron
77824a24ef
Merge pull request #2988 from YaLTeR/fix-issue-2922
Use correct indent in rewrite_bare_fn with Visual style
2018-09-11 15:50:13 +12:00
Nick Cameron
29df2179b7
Merge pull request #3007 from alexcrichton/wasm
Support platforms without a timer
2018-09-10 09:50:49 +12:00
Alex Crichton
46e2a2e7c7 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/
2018-09-09 11:13:15 -07:00
lqd
4b7130dfa1 normalize_doc_attributes option: convert doc attributes to comments
Convert `#![doc]` and `#[doc]` attributes to `//!` and `///` doc comments.
2018-09-07 21:58:35 +02:00
Stéphane Campinas
6f318e3cef
propagate errors about failing to rewrite a macro 2018-09-07 14:48:52 +02:00
David Hotham
90ec5a226f Fix typo in usage text 2018-09-07 09:01:44 +01:00
Robert Bartlensky
992b179d33 Change print_diff to output the correct line number. 2018-09-06 17:18:33 +01:00
Nick Cameron
6ada5b51cc
Merge pull request #2997 from matthiaskrgr/cargo_test_release
fix cargo test --release
2018-09-06 17:40:08 +12:00
Matthias Krüger
e058a3f7e7 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
2018-09-06 02:07:09 +02:00
Nick Cameron
f655671e12
Merge pull request #2983 from topecongiro/issue-2642
Handle raw string literals in CharClasses
2018-09-04 19:11:49 +12:00
Nick Cameron
414f98e775
Merge pull request #2993 from topecongiro/rustc-ap
Cargo update
2018-09-04 19:11:23 +12:00
topecongiro
1704e24956 Cargo update 2018-09-04 00:17:26 +09:00
Nick Cameron
2291be7fa1
Merge pull request #2992 from max-sixty/clippy2
Clippy 2/2
2018-09-03 13:25:35 +12:00
Nick Cameron
a67208f212
Merge pull request #2986 from topecongiro/issue-2907
Handle chain w/ try operators with spaces
2018-09-03 13:10:50 +12:00
Nick Cameron
5fb9418aec
Merge pull request #2991 from topecongiro/raw-identifier-in-chain
Handle raw identifiers in chain
2018-09-03 13:08:19 +12:00
Maximilian Roos
968affc3e0
final clippy changes 2018-09-01 16:32:38 -04:00
Seiichi Uchida
08e282877a Handle raw identifiers in chain 2018-09-01 16:18:27 +09:00
Seiichi Uchida
627780864f
Merge pull request #2987 from YaLTeR/fix-issue-2930
Use correct shape in Visual tuple rewriting
2018-09-01 16:04:14 +09:00
Ivan Molodetskikh
54f8bcb5a2
Use correct fn args indent for Visual 2018-08-31 16:53:18 +03:00
Ivan Molodetskikh
05b6aaa130
Add debug logging to fn-related functions 2018-08-31 16:52:45 +03:00
Ivan Molodetskikh
430f848c75
Add a test for #2922 2018-08-31 16:25:01 +03:00
Ivan Molodetskikh
6a029974de
Fix shape in rewrite_tuple_in_visual_indent_style 2018-08-31 15:50:41 +03:00
Ivan Molodetskikh
098a5391f0
Add a test for #2930 2018-08-31 15:25:08 +03:00
Seiichi Uchida
ec6086b802
Merge pull request #2984 from mehcode/feature/edition-option
Accept 2015 and 2018 instead of Edition2015 and Edition2018 for edition option
2018-08-31 18:26:19 +09:00
Seiichi Uchida
ba9e159722 Update tests 2018-08-31 18:20:28 +09:00
Seiichi Uchida
20aac086d6 Simplify post-comment extraction 2018-08-31 18:20:28 +09:00
Seiichi Uchida
9df1dbe1ac Use trim_tries to extract post comment over simple trim_matches 2018-08-31 18:20:28 +09:00
Seiichi Uchida
612f1af734 Use trim_tries to extract pre-comments over simple trim_matches 2018-08-31 18:20:28 +09:00
Seiichi Uchida
2880d59ec0 Add trim_tries 2018-08-31 18:20:25 +09:00
Seiichi Uchida
1b8f0ff1b6 Add a test for #2907 2018-08-31 18:10:47 +09:00
Ryan Leckey
eec74360dc Accept 2015 and 2018 instead of Edition2015 and Edition2018 for edition option 2018-08-31 00:04:23 -07:00
Maximilian Roos
b1da2a53b4
Merge branch 'master' into clippy2 2018-08-31 00:19:12 -04:00
topecongiro
67480422b9 Handle raw string literal without any sharps 2018-08-31 10:49:39 +09:00
topecongiro
309be479b2 Handle raw string literals in CharClasses 2018-08-31 10:37:46 +09:00
topecongiro
c903119d8d Add a test for #2642 2018-08-31 10:37:22 +09:00
Nick Cameron
d88139893f
Merge pull request #2981 from topecongiro/issue-2956
Keep formatting fn even if there is an unformattable argument
2018-08-31 10:43:06 +12:00
Seiichi Uchida
ad903e08fd Keep formatting fn even if there is an unformattable argument 2018-08-30 23:39:39 +09:00
Seiichi Uchida
d8301050a5 Add a test for #2956 2018-08-30 23:38:40 +09:00
Nick Cameron
68015ecf52
Merge pull request #2980 from davidalber/use-stable-in-travis
Use stable Rust in Travis CI config snippet
2018-08-30 20:23:00 +12:00
David Alber
c69b9601c2 Use stable Rust in Travis CI config snippet
In #2725 the Travis CI config snippet was changed to use nightly
Rust because the stable rustfmt of the time (rustfmt 0.4.1-stable)
did not contain the `--check` flag, which is used in the Travis
config snippet. The current stable rustfmt (rustfmt 0.8.2-stable)
does contain the `--check` flag, so it is now possible to use the
Travis config in the README with stable rustfmt.
2018-08-29 21:59:12 -07:00
Nick Cameron
1a6f215fb5
Merge pull request #2975 from max-sixty/clippy
Some clippy changes
2018-08-30 16:43:04 +12:00
Nick Cameron
b784f23484
Merge pull request #2952 from crw5996/fix-use-bug
Fixed modsep operator for various rustlang editions
2018-08-30 11:18:04 +12:00
Maximilian Roos
af7b341a50
Merge branch 'master' into clippy2 2018-08-28 21:57:15 -04:00