Commit Graph

3137 Commits

Author SHA1 Message Date
Seiichi Uchida
88a3c60f63 Update tests 2018-03-09 14:07:43 +09:00
Seiichi Uchida
2a99d9704f Use overflow::rewrite_with_angle_brackets to rewrite generics 2018-03-09 14:07:43 +09:00
Seiichi Uchida
ae629abc41 Add overflow module
This commit adds `overflow` module. This module provides two APIs.
`rewrite_with_parens` is basically the same as `rewrite_call_inner`.
`rewrite_with_angle_brackets` is used for rewriting generics and types.
2018-03-09 14:07:43 +09:00
Seiichi Uchida
8943c376bc Use RefCell for RewriteContext fields 2018-03-09 14:07:05 +09:00
Nick Cameron
dc2f1429e7
Merge pull request #2521 from topecongiro/issue-2520
Fix bugs when rewriting doc comments with code block
2018-03-09 15:18:53 +13:00
Nick Cameron
58fb47a8ca
Merge pull request #2519 from topecongiro/nested-parens
Remove nested parens
2018-03-09 15:16:30 +13:00
Nick Cameron
5f99ebe628
Merge pull request #2518 from topecongiro/issue-2491
Disallow combining parens and brackets in impl
2018-03-09 15:15:21 +13:00
Nick Cameron
1780d68761 Catch panics in the parser before they crash rustfmt
Closes #753
2018-03-09 14:59:52 +13:00
Seiichi Uchida
484469899b Keep code block without correct backticks enclosing 2018-03-09 09:46:43 +09:00
Seiichi Uchida
67fa394e4e Restrict the width of doc comments with comment_width
See the diff in tests/target/enum.rs for an example.
2018-03-09 09:34:13 +09:00
Seiichi Uchida
9344d2ca83 Fix a bug in attr::take_while_with_pred
Closes #2520.
2018-03-09 09:29:08 +09:00
Seiichi Uchida
0acc0a2989 Add a test for #2520 2018-03-09 09:28:49 +09:00
Nick Cameron
c829875960 List limitations in the README
Closes #2109
2018-03-09 11:16:21 +13:00
Seiichi Uchida
9502de14be Update tests 2018-03-08 20:25:41 +09:00
Seiichi Uchida
d45aa55bd6 Remove nested parens
And make sure that we do not remove comments within parens.
2018-03-08 20:25:18 +09:00
Seiichi Uchida
06f5d55dde Add a test for removing nested parens 2018-03-08 20:25:06 +09:00
Seiichi Uchida
10e37fd42e Update tests 2018-03-08 19:08:56 +09:00
Seiichi Uchida
71ca21fc23 Disallow combining parens and brackets in impl 2018-03-08 19:08:38 +09:00
Seiichi Uchida
b2d3daccfa Add a test for #2491 2018-03-08 19:08:32 +09:00
Seiichi Uchida
a6b574bfa7 Cargo update and cargo clippy 2018-03-08 18:10:23 +09:00
moe
a2f861730e fix adds a trailing comma to struct-like macro (#2490)
* fix adds a trailing comma to struct-like macro
2018-03-08 18:05:39 +09:00
Nick Cameron
06d509c25c
Merge pull request #2512 from topecongiro/rustc-ap-syntax
Update rustc-ap-syntax
2018-03-08 17:13:05 +13:00
Seiichi Uchida
9889678f56 Replace Option<Vec<&'a ast::pat>> with Vec<&'a ast::Pat> 2018-03-08 12:56:28 +09:00
Nick Cameron
f0d179dd12
Merge pull request #2456 from dlukes/feat/check-license
Attempt at checking for license (#209)
2018-03-08 15:36:27 +13:00
Nick Cameron
e01753909f
Merge pull request #2508 from topecongiro/issue-2494
Only format code blocks in comments with rust syntax notation
2018-03-08 15:29:37 +13:00
Nick Cameron
5f1dbe455b
Merge pull request #2517 from davidalber/update-conduct
Propagating upstream code of conduct changes
2018-03-08 14:28:49 +13:00
David Alber
7d85e1368e Synchronizing with code of conduct in rust-www
This is propagated from rust-lang/rust-www#1062.
2018-03-07 08:58:34 -08:00
Seiichi Uchida
b9843d17c3
Merge pull request #2515 from sinkuu/nested_shape_lazy_static
Use nested_shape for indenting types of lazy_static
2018-03-07 16:06:52 +09:00
Shotaro Yamada
b3fa50db73 Use nested_shape for indenting types of lazy_static 2018-03-07 10:51:28 +09:00
Seiichi Uchida
3f0b630845 Support parentheses in patterns 2018-03-06 20:07:09 +09:00
Seiichi Uchida
520f0d65ef Format multiple patterns in 'if let' and `while let'
Closes #2511.
2018-03-06 20:02:04 +09:00
Seiichi Uchida
d7495324bc Work around removal of beginning_vert field from ast::Arm
`ast::Arm` used to have `beginning_vert` field whose type is `Option<Span>`
and holds a span of the beginning `|` if available. This field is now removed.
This commit works around that.

Since we only need a `BytePos` of the `|`, the type of `beginning_vert` in
`ArmWrapper` is `Option<BytePos>`.
2018-03-06 19:56:49 +09:00
Seiichi Uchida
5416c4df76 Modify code around ast::Visibility
`ast::Visibility` is changed to `codemap::Spanned` whose node is
`ast::VisibilityKind`. This commit fixes it.

Closes #2398.
2018-03-06 19:47:28 +09:00
Seiichi Uchida
d316eba54d Add opt_span_before() to SpanUtils trait
With some refactorings to avoid duplicated code.
2018-03-06 19:46:03 +09:00
Seiichi Uchida
64d838490a Cargo update
Bump `rustc-ap-syntax` and `rustc-ap-rustc_errors` to `57.0.0`.
2018-03-06 19:45:17 +09:00
Seiichi Uchida
0393037d6e Add tests for #2398 2018-03-06 19:42:55 +09:00
Seiichi Uchida
3fc8bb19a6 Add tests for #2511 2018-03-06 19:42:38 +09:00
Seiichi Uchida
61919022dd
Merge pull request #2507 from kngwyu/issue-2506
Issue 2506
2018-03-06 00:41:16 +09:00
kngwyu
8ea79aa025 add offset_left(4) for 'dyn ' 2018-03-05 22:45:40 +09:00
David Lukes
01f652799d Make license doctest pass again 2018-03-05 13:39:30 +01:00
David Lukes
085cc90599 Load and compile template in proper function
Get rid of the unncessary closure.
2018-03-05 13:25:47 +01:00
David Lukes
1db84a3ec5 Wrap license-related errors in enum 2018-03-05 13:20:51 +01:00
David Lukes
53347bc226 Add license_template_path configuration snippet 2018-03-05 13:19:46 +01:00
David Lukes
533d185f49 Shorten var names to comply with line len reqs 2018-03-05 13:19:46 +01:00
David Lukes
b33451b4ed Fix indentation in create_config macro definition 2018-03-05 13:18:27 +01:00
David Lukes
bbd6d9cd55 Refactor parsing code into struct
This also splits the giant state machine match expression into separate
methods.
2018-03-05 13:18:27 +01:00
David Lukes
310c1146f2 Move license template parsing into submodule 2018-03-05 13:13:55 +01:00
David Lukes
e48d7f3ebb Account for possibly empty license_template_path
Don't attempt to load license_template if the path wasn't specified.
2018-03-05 13:13:55 +01:00
David Lukes
ead81205cc Simplify match → if let 2018-03-05 13:13:55 +01:00
David Lukes
ad76741bca Move license template parsing into config phase 2018-03-05 13:13:55 +01:00