Commit Graph

367 Commits

Author SHA1 Message Date
Seiichi Uchida
c9479de9a7 Avoid panic on macro inside deeply nested block
Closes #3457.
2019-03-19 10:50:44 +09:00
Seiichi Uchida
ce5cccc32c
Update rustc-ap-* crates to 407.0.0 (#3447) 2019-03-14 22:50:53 +09:00
Seiichi Uchida
5f3dfe6c51
Format the if expression at the end of the block in a single line (#3338) 2019-03-11 23:18:43 +09:00
Alexander Regueiro
7a3b7c9275 Various cosmetic improvements (#3403) 2019-02-19 11:56:42 +09:00
topecongiro
96a3df3b5c Format visibility on trait alias 2019-02-12 10:16:12 +09:00
Hirokazu Hata
4bb90f5cc8 Fix rust_2018_idioms warnings 2019-02-09 16:14:30 +09:00
Seiichi Uchida
672f352c89
Merge pull request #3325 from topecongiro/rustcap
Update rustc-ap-* crates to 366.0.0
2019-02-08 00:24:57 +09:00
Evgenii
2502939b60 fix review comments 2019-02-07 10:55:55 +03:00
topecongiro
f4f9502ea7 Cargo update
- Update `rustc-ap-*` crates to 366.0.0
- Update the other crates to the latest stable
2019-02-06 23:06:15 +09:00
Evgenii
da2d8a4c57 calculate statement first line properly 2019-02-06 10:05:51 +03:00
Evgenii
ece629b1cc transition to Rust 2018 2019-02-04 13:30:43 +03:00
Stéphane Campinas
d121d7205f
fix logic for adding or not a newline after a missed span 2018-11-09 20:50:07 +01:00
Stéphane Campinas
2f5d864c08
keep track of lines which formatting was disabled in order to prevent indentation which would cause code right-shifting 2018-10-24 12:11:11 +02:00
Stéphane Campinas
9c75a15f4c
Fix handling of code that is annotated with rustfmt::skip.
A rustfmt::skip'ed block is indented although original lines are
returned. In order to resolve this, the leading whitespaces are trimmed
on each line while retaining the layout; this leaves the skipped code
to be indented as necessary by the caller.
2018-10-24 12:11:11 +02:00
Matthias Krüger
8c996331cc fix a couple of clippy lint warnings
simplify a comparison with "true"
fn can_be_overflowed: remove unused lifetime
fn rewrite_pairs_one_line: pass "list" by reference (it is not consumed in the function)
fn span_for_token_stream: pass "token_stream" by reference since it is not consumed
use tool lints for clippy suppressions
2018-10-19 01:11:28 +02:00
Nick Cameron
4bb84f6002 Remove NLL feature
And do some refactoring in comments.rs

Closes #3107
2018-10-18 15:39:11 +13:00
Shotaro Yamada
751bcf5fa0 Clippy 2018-10-15 23:59:08 +09:00
Shotaro Yamada
094e687e42 Remove an unsafe code 2018-10-15 23:58:59 +09:00
Nick Cameron
cd8549e013
Merge pull request #3036 from topecongiro/issue-2932
Combine chain items only when the item gets orphaned otherwise
2018-09-20 11:36:46 +12:00
Seiichi Uchida
e2b9c66cc9 Cargo fmt 2018-09-19 23:22:26 +09:00
Seiichi Uchida
7eca33f8a5 Format generics on associated types 2018-09-19 22:33:28 +09:00
Stéphane Campinas
1befc93ba0
implement Drop from FmtVisitor in order to simplify failures passing 2018-09-12 13:09:07 +02:00
Stéphane Campinas
6f318e3cef
propagate errors about failing to rewrite a macro 2018-09-07 14:48:52 +02:00
Maximilian Roos
968affc3e0
final clippy changes 2018-09-01 16:32:38 -04:00
Maximilian Roos
7d60e3a1ad
more clippy 2018-08-28 21:57:08 -04:00
cad97
fc1909d311 Reformat 2018-08-23 17:14:19 -04:00
cad97
04d804c365 Rename CodeMap/FileMap to SourceMap/SourceFile
#2946
2018-08-23 17:10:46 -04:00
Seiichi Uchida
d96e3ca604 Explicitly handle semicolon after the item in statement position 2018-08-04 09:59:38 +09:00
Ben Brittain
0b25f602fd Format Async block and async fn 2018-07-29 08:05:38 -07:00
Seiichi Uchida
6cecdd681f Put lifetimes after trait when they gets orphaned 2018-07-25 08:44:32 +09:00
Seiichi Uchida
fc307ff582 Format exitential type 2018-07-25 00:30:01 +09:00
Seiichi Uchida
cc2afeca9e Fix compile errors from breaking changes 2018-06-28 16:26:10 +09:00
Seiichi Uchida
3027c21371 Handle raw identifiers 2018-06-25 23:36:45 +09:00
topecongiro
e5e1e0cea8 Fix compile errors from breaking changes in libsyntax
cc https://github.com/rust-lang/rust/pull/48149.
2018-06-25 15:24:00 +09:00
Seiichi Uchida
19054347ca Fix test failures 2018-06-07 15:20:01 +09:00
Seiichi Uchida
d1477ca1de Add a field in Summary for notiyfing about formatting failure of macro 2018-06-07 12:32:58 +09:00
Nick Cameron
843c12601a Use our own FileName struct rather than exporting libsyntax's 2018-05-21 12:08:39 +12:00
Nick Cameron
abb253df8b Rationalise result and error types 2018-05-21 08:58:53 +12:00
Nick Cameron
2ee8b0e4c5 Remove remove_blank_lines_at_start_or_end_of_block
cc #1974
2018-05-18 16:56:55 +12:00
Nick Cameron
390a284851 Give a deprecation warning on rustfmt_skip and an error on rustfmt:: other than skip 2018-05-14 18:10:46 +12:00
topecongiro
bd25c7d0f7 Cargo fmt 2018-05-08 06:25:48 +09:00
topecongiro
e59ceaf954 Do not duplicate attributes on use items 2018-05-06 17:01:14 +09:00
csmoe
f7415bcea2 update self format 2018-04-29 20:53:31 +08:00
Shotaro Yamada
ba792a7fa2 Remove redudant parens 2018-04-01 22:29:26 +09:00
Seiichi Uchida
903de92dae Avoid cloning RewriteContext 2018-03-25 20:20:50 +09:00
Nick Cameron
50c95a074a cargo fmt 2018-03-20 09:27:31 +13:00
Matthew McAllister
c5168405b0 Format attributes on block expressions 2018-03-14 01:16:19 +09:00
Seiichi Uchida
8943c376bc Use RefCell for RewriteContext fields 2018-03-09 14:07:05 +09:00
Nick Cameron
39301ae5f2 Go back to a non-workspace structure
Kinda reverts https://github.com/rust-lang-nursery/rustfmt/pull/2419
2018-03-02 14:58:23 +13:00
topecongiro
4af2aa3a9e Create rustfmt_core crate 2018-02-07 22:48:05 +09:00