]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoAdd `rustc-workspace-hack` workaround like RLS/Cargo
Alex Crichton [Wed, 17 Oct 2018 19:47:21 +0000 (12:47 -0700)]
Add `rustc-workspace-hack` workaround like RLS/Cargo

5 years agoCatch parser panic in format_snippet (#3103)
Seiichi Uchida [Wed, 17 Oct 2018 05:21:04 +0000 (14:21 +0900)]
Catch parser panic in format_snippet (#3103)

5 years agoMerge pull request #3106 from sinkuu/clippy
Nick Cameron [Mon, 15 Oct 2018 20:09:56 +0000 (09:09 +1300)]
Merge pull request #3106 from sinkuu/clippy

Clippy and cleanups

5 years agoMerge pull request #3102 from nrc/arm-guard-newline
Nick Cameron [Mon, 15 Oct 2018 20:06:15 +0000 (09:06 +1300)]
Merge pull request #3102 from nrc/arm-guard-newline

 Only put `{` on a newline in a match arm where necessary

5 years agoMerge pull request #3101 from nrc/pair-newline
Nick Cameron [Mon, 15 Oct 2018 20:01:40 +0000 (09:01 +1300)]
Merge pull request #3101 from nrc/pair-newline

Simplify multi-lining binop exprs

5 years agoCargo.lock
Shotaro Yamada [Mon, 15 Oct 2018 14:50:01 +0000 (23:50 +0900)]
Cargo.lock

5 years agoReduce allocations
Shotaro Yamada [Mon, 15 Oct 2018 12:20:03 +0000 (21:20 +0900)]
Reduce allocations

5 years agoUse concat() instead of join("")
Shotaro Yamada [Mon, 15 Oct 2018 12:10:34 +0000 (21:10 +0900)]
Use concat() instead of join("")

5 years agoCleanup
Shotaro Yamada [Wed, 10 Oct 2018 01:50:25 +0000 (10:50 +0900)]
Cleanup

5 years agoClippy
Shotaro Yamada [Mon, 15 Oct 2018 11:36:39 +0000 (20:36 +0900)]
Clippy

5 years agoUse UnOp::to_string
Shotaro Yamada [Tue, 9 Oct 2018 12:47:00 +0000 (21:47 +0900)]
Use UnOp::to_string

5 years agoRemove an unsafe code
Shotaro Yamada [Tue, 9 Oct 2018 12:28:40 +0000 (21:28 +0900)]
Remove an unsafe code

5 years agotry to fix comment bad wrapping (#3099)
Daniele D'Orazio [Mon, 15 Oct 2018 02:18:37 +0000 (04:18 +0200)]
try to fix comment bad wrapping (#3099)

5 years agoAdd test (issue 3005)
Nick Cameron [Mon, 15 Oct 2018 01:09:31 +0000 (14:09 +1300)]
Add test (issue 3005)

5 years agoOnly put `{` on a newline in a match arm where necessary
Nick Cameron [Mon, 15 Oct 2018 01:06:52 +0000 (14:06 +1300)]
Only put `{` on a newline in a match arm where necessary

Fixes #3005

5 years agoadd test
Nick Cameron [Sun, 14 Oct 2018 23:09:53 +0000 (12:09 +1300)]
add test

5 years agoMerge pull request #3096 from otavio/use-bytecount-count
Nick Cameron [Sun, 14 Oct 2018 23:07:58 +0000 (11:07 +1200)]
Merge pull request #3096 from otavio/use-bytecount-count

utils: rewrite `count_newlines` using `bytecount::count`

5 years agoFixup formatting
Nick Cameron [Sun, 14 Oct 2018 22:52:27 +0000 (11:52 +1300)]
Fixup formatting

5 years agoSimplify situations in which the last sub-expr in a bin-op can go multiline without...
Nick Cameron [Sun, 14 Oct 2018 22:48:12 +0000 (11:48 +1300)]
Simplify situations in which the last sub-expr in a bin-op can go multiline without making the whole expr multiline

Fixes #3034

5 years agoutils: rewrite `count_newlines` using `bytecount::count`
Otavio Salvador [Sat, 13 Oct 2018 20:39:19 +0000 (17:39 -0300)]
utils: rewrite `count_newlines` using `bytecount::count`

This uses a optimized byte count and also makes use of SIMD
instructions to optimize the processing of the byte arrays.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agoMerge pull request #3100 from topecongiro/issue-3092
Nick Cameron [Sun, 14 Oct 2018 20:07:59 +0000 (08:07 +1200)]
Merge pull request #3100 from topecongiro/issue-3092

Fix poor formatting of empty trait with generic bounds

5 years agoMerge pull request #3093 from scampi/issue2633
Nick Cameron [Sun, 14 Oct 2018 19:57:39 +0000 (07:57 +1200)]
Merge pull request #3093 from scampi/issue2633

do not vertically align list items in case the tactic is Horizontal

5 years agoMerge pull request #3091 from topecongiro/issue-3060
Nick Cameron [Sun, 14 Oct 2018 19:40:34 +0000 (07:40 +1200)]
Merge pull request #3091 from topecongiro/issue-3060

Do not add parens around lifetimes

5 years agoUse correct width
Seiichi Uchida [Sun, 14 Oct 2018 12:44:56 +0000 (21:44 +0900)]
Use correct width

When rewriting trait bounds on the next line, we do not want to add an extra
indentation. However, the max width should be smaller.

5 years agoAdd a correct indent before trait's closing brace with empty body
Seiichi Uchida [Sun, 14 Oct 2018 12:43:59 +0000 (21:43 +0900)]
Add a correct indent before trait's closing brace with empty body

5 years agoAdd a test for #3092
Seiichi Uchida [Sun, 14 Oct 2018 12:43:35 +0000 (21:43 +0900)]
Add a test for #3092

5 years agoMerge pull request #3095 from otavio/avoid-overflow-control-flow-expr
Seiichi Uchida [Sun, 14 Oct 2018 12:03:27 +0000 (21:03 +0900)]
Merge pull request #3095 from otavio/avoid-overflow-control-flow-expr

Avoid control flow expressions conditions to go multi line

5 years agoMerge pull request #3094 from otavio/avoid-unwrap-or
Seiichi Uchida [Sun, 14 Oct 2018 12:02:39 +0000 (21:02 +0900)]
Merge pull request #3094 from otavio/avoid-unwrap-or

Replace `.unwrap_or` with `.map_or` in few places

5 years agoAvoid control flow expressions conditions to go multi line
Otavio Salvador [Sat, 13 Oct 2018 12:05:54 +0000 (09:05 -0300)]
Avoid control flow expressions conditions to go multi line

Extends the multi line condition to over other control flow
expressions, it now covers: `if`, `if let`, `for`, `loop`, `while`,
`while let` and `match`.

Refs: #3029

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agohandle lines prefixed with a # inside code blocks
Stéphane Campinas [Sat, 13 Oct 2018 07:57:43 +0000 (09:57 +0200)]
handle lines prefixed with a # inside code blocks

5 years agoMerge pull request #3090 from otavio/issue-3029
Seiichi Uchida [Sat, 13 Oct 2018 01:36:31 +0000 (10:36 +0900)]
Merge pull request #3090 from otavio/issue-3029

Only combine `match` if its condition expression fits in a single line

5 years agobin: replace `.unwrap_or` with `.map_or`
Otavio Salvador [Fri, 12 Oct 2018 23:22:10 +0000 (20:22 -0300)]
bin: replace `.unwrap_or` with `.map_or`

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agoconfig: replace `.unwrap_or` with `.map_or`
Otavio Salvador [Fri, 12 Oct 2018 23:21:48 +0000 (20:21 -0300)]
config: replace `.unwrap_or` with `.map_or`

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agoexpr: replace `.unwrap_or` with `.map_or`
Otavio Salvador [Fri, 12 Oct 2018 23:21:22 +0000 (20:21 -0300)]
expr: replace `.unwrap_or` with `.map_or`

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agoOnly combine `match` if its condition expression fits in a single line
Otavio Salvador [Mon, 8 Oct 2018 23:49:33 +0000 (20:49 -0300)]
Only combine `match` if its condition expression fits in a single line

This improves the formatting and reading of code avoiding the
condition expression to be rewrite, if it goes multi line.

Fixes: #3029.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agoclosures: replace `.unwrap_or` with `.map_or`
Otavio Salvador [Fri, 12 Oct 2018 23:07:25 +0000 (20:07 -0300)]
closures: replace `.unwrap_or` with `.map_or`

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agodo not vertically align list items in case the tactic is Horizontal
Stéphane Campinas [Fri, 12 Oct 2018 18:41:56 +0000 (20:41 +0200)]
do not vertically align list items in case the tactic is Horizontal

5 years agoDo not add parens around lifetimes
Seiichi Uchida [Fri, 12 Oct 2018 15:41:17 +0000 (00:41 +0900)]
Do not add parens around lifetimes

Parens should be added only around trait objects.

5 years agoAdd a test for #3060
Seiichi Uchida [Fri, 12 Oct 2018 15:40:34 +0000 (00:40 +0900)]
Add a test for #3060

5 years agoAdd `attr_fn_like_width` to the width heuristics
Nick Cameron [Fri, 12 Oct 2018 02:17:27 +0000 (15:17 +1300)]
Add `attr_fn_like_width` to the width heuristics

It is a bit larger than than `fn_call_width` which we used previously, so fewer attributes get reformatted.

Closes #2929

5 years agoMerge pull request #3089 from topecongiro/format-comment
Nick Cameron [Thu, 11 Oct 2018 21:55:45 +0000 (09:55 +1200)]
Merge pull request #3089 from topecongiro/format-comment

Add format_doc_comments

5 years agoMerge pull request #3086 from otavio/bump-rustc-ap-272
Nick Cameron [Thu, 11 Oct 2018 21:45:33 +0000 (09:45 +1200)]
Merge pull request #3086 from otavio/bump-rustc-ap-272

Update rustc-ap-* to 272.0.0

5 years agoAdd format_doc_comments
Seiichi Uchida [Thu, 11 Oct 2018 14:10:57 +0000 (23:10 +0900)]
Add format_doc_comments

5 years agoMerge pull request #3088 from otavio/fix-misleading-comment
Seiichi Uchida [Thu, 11 Oct 2018 13:52:17 +0000 (22:52 +0900)]
Merge pull request #3088 from otavio/fix-misleading-comment

rewrite: adjust comment as it refers to `is_if_else_block`

5 years agorewrite: adjust comment as it refers to `is_if_else_block`
Otavio Salvador [Thu, 11 Oct 2018 13:21:15 +0000 (10:21 -0300)]
rewrite: adjust comment as it refers to `is_if_else_block`

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agoMerge pull request #3087 from scampi/lineoverflow
Seiichi Uchida [Thu, 11 Oct 2018 08:36:39 +0000 (17:36 +0900)]
Merge pull request #3087 from scampi/lineoverflow

fixed display message for the LineOverflow error

5 years agofixed display message for the LineOverflow error
Stéphane Campinas [Thu, 11 Oct 2018 07:05:33 +0000 (09:05 +0200)]
fixed display message for the LineOverflow error

5 years agoUpdate rustc-ap-* to 272.0.0
Otavio Salvador [Thu, 11 Oct 2018 00:53:25 +0000 (21:53 -0300)]
Update rustc-ap-* to 272.0.0

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agoMerge pull request #3084 from otavio/issue-1990
Nick Cameron [Tue, 9 Oct 2018 22:40:18 +0000 (10:40 +1200)]
Merge pull request #3084 from otavio/issue-1990

Enable `stdin_disable_all_formatting_test` test

5 years agoMerge pull request #3083 from scampi/itemized_blocks
Nick Cameron [Tue, 9 Oct 2018 22:38:54 +0000 (10:38 +1200)]
Merge pull request #3083 from scampi/itemized_blocks

Handle itemized blocks in comments

5 years agorewrite_string: detect when a url is being split and place the new line
Stéphane Campinas [Tue, 9 Oct 2018 19:47:32 +0000 (21:47 +0200)]
rewrite_string: detect when a url is being split and place the new line
after it

5 years agoMerge pull request #3085 from otavio/extend-gitignore
Seiichi Uchida [Tue, 9 Oct 2018 13:49:33 +0000 (22:49 +0900)]
Merge pull request #3085 from otavio/extend-gitignore

.gitignore: Ignore Emacs backup files

5 years agoEnable `stdin_disable_all_formatting_test` test
Otavio Salvador [Tue, 9 Oct 2018 12:06:16 +0000 (09:06 -0300)]
Enable `stdin_disable_all_formatting_test` test

Fixes: #1990.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years ago.gitignore: Ignore Emacs backup files
Otavio Salvador [Tue, 9 Oct 2018 08:25:31 +0000 (05:25 -0300)]
.gitignore: Ignore Emacs backup files

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agohandle itemized items inside comments
Stéphane Campinas [Mon, 8 Oct 2018 09:44:23 +0000 (11:44 +0200)]
handle itemized items inside comments

5 years agoMerge pull request #3082 from otavio/bump-dependencies
Nick Cameron [Mon, 8 Oct 2018 20:01:25 +0000 (08:01 +1200)]
Merge pull request #3082 from otavio/bump-dependencies

Bump dependencies

5 years agoMerge pull request #3080 from topecongiro/issue-3031
Nick Cameron [Mon, 8 Oct 2018 20:00:45 +0000 (08:00 +1200)]
Merge pull request #3080 from topecongiro/issue-3031

Format macro calls with item-like arguments

5 years agoBump rustc-ap-* to 270.0.0
Otavio Salvador [Mon, 8 Oct 2018 17:42:54 +0000 (14:42 -0300)]
Bump rustc-ap-* to 270.0.0

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agoReplace `isatty` crate with `atty`
Otavio Salvador [Mon, 8 Oct 2018 17:39:16 +0000 (14:39 -0300)]
Replace `isatty` crate with `atty`

The `isatty` crate has been deprecated and a replacement has been
released for it called `atty`. It offers a nicer API and the code
change to adapt is trivial.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
5 years agorewrite_string: allow to break on a boundary character that is on edge
Stéphane Campinas [Sun, 7 Oct 2018 20:57:07 +0000 (22:57 +0200)]
rewrite_string: allow to break on a boundary character that is on edge

5 years agorewrite_string: retain blank lines that are trailing
Stéphane Campinas [Sun, 7 Oct 2018 20:53:48 +0000 (22:53 +0200)]
rewrite_string: retain blank lines that are trailing

5 years agorewrite_string: take care of blank lines appearing within the last line
Stéphane Campinas [Fri, 5 Oct 2018 15:09:17 +0000 (17:09 +0200)]
rewrite_string: take care of blank lines appearing within the last line

5 years agorewrite_string: handle newlines in the last line that fits in the shape for cases...
Stéphane Campinas [Thu, 4 Oct 2018 11:56:57 +0000 (13:56 +0200)]
rewrite_string: handle newlines in the last line that fits in the shape for cases where line_start is not a whitespace

5 years agorewrite_string: do not overflow the next line when the line_start is not a whitespace
Stéphane Campinas [Thu, 4 Oct 2018 09:40:47 +0000 (11:40 +0200)]
rewrite_string: do not overflow the next line when the line_start is not a whitespace

5 years agorewrite_string: trim trailing whitespace in case the last_line fits in the given...
Stéphane Campinas [Thu, 4 Oct 2018 07:16:08 +0000 (09:16 +0200)]
rewrite_string: trim trailing whitespace in case the last_line fits in the given shape

5 years agoFormat a macro call with multile item-like arguments
Seiichi Uchida [Mon, 8 Oct 2018 04:49:24 +0000 (13:49 +0900)]
Format a macro call with multile item-like arguments

5 years agoFormat a macro call with a single item-like argument
Seiichi Uchida [Mon, 8 Oct 2018 04:40:10 +0000 (13:40 +0900)]
Format a macro call with a single item-like argument

5 years agoAdd a test for #3031 and update test
Seiichi Uchida [Mon, 8 Oct 2018 04:38:01 +0000 (13:38 +0900)]
Add a test for #3031 and update test

No combining for an item-like macro argument.

5 years agoMerge pull request #3078 from YaLTeR/fix-closure-indentation
Nick Cameron [Mon, 8 Oct 2018 01:38:49 +0000 (14:38 +1300)]
Merge pull request #3078 from YaLTeR/fix-closure-indentation

Fix inconsistent overflow behavior in Visual style

5 years agoMerge pull request #3077 from YaLTeR/fix-extra-commas
Nick Cameron [Mon, 8 Oct 2018 01:37:48 +0000 (14:37 +1300)]
Merge pull request #3077 from YaLTeR/fix-extra-commas

Get rid of extra commas in Visual struct literal formatting

5 years agoMerge pull request #3070 from topecongiro/issue-3030
Nick Cameron [Mon, 8 Oct 2018 00:05:36 +0000 (13:05 +1300)]
Merge pull request #3070 from topecongiro/issue-3030

Format a paren expr with double slash comment

5 years agoMerge pull request #3069 from topecongiro/issue-3003
Nick Cameron [Mon, 8 Oct 2018 00:04:45 +0000 (13:04 +1300)]
Merge pull request #3069 from topecongiro/issue-3003

Consider a multi-lined array as a block-like expression

5 years agoMerge pull request #3067 from topecongiro/refactor-toexpr
Nick Cameron [Sun, 7 Oct 2018 23:38:33 +0000 (12:38 +1300)]
Merge pull request #3067 from topecongiro/refactor-toexpr

Add println!-like heuristic to the fail attribute

5 years agoMerge pull request #3063 from otavio/add-doc-is_doc_comment
Nick Cameron [Sun, 7 Oct 2018 21:41:18 +0000 (10:41 +1300)]
Merge pull request #3063 from otavio/add-doc-is_doc_comment

comment: Add documentation to `is_doc_comment` public method

5 years agoMerge pull request #3079 from topecongiro/rustc-ap
Seiichi Uchida [Sat, 6 Oct 2018 22:37:44 +0000 (07:37 +0900)]
Merge pull request #3079 from topecongiro/rustc-ap

Cargo update

5 years agoFix empty types being inserted to closure
Seiichi Uchida [Sat, 6 Oct 2018 15:52:06 +0000 (00:52 +0900)]
Fix empty types being inserted to closure

cc https://github.com/rust-lang/rust/pull/54229.

5 years agoCargo update
Seiichi Uchida [Sat, 6 Oct 2018 15:39:49 +0000 (00:39 +0900)]
Cargo update

5 years agoOverflow Visual functions even with one argument
Ivan Molodetskikh [Sat, 6 Oct 2018 13:32:38 +0000 (16:32 +0300)]
Overflow Visual functions even with one argument

5 years agoAdd a test for #3049
Ivan Molodetskikh [Sat, 6 Oct 2018 08:20:46 +0000 (11:20 +0300)]
Add a test for #3049

5 years agoNo trailing comma in struct literals (Visual)
Ivan Molodetskikh [Sat, 29 Sep 2018 09:16:03 +0000 (12:16 +0300)]
No trailing comma in struct literals (Visual)

5 years agoAdd a test for #3066
Ivan Molodetskikh [Sat, 29 Sep 2018 08:57:06 +0000 (11:57 +0300)]
Add a test for #3066

5 years agoMerge pull request #3073 from scampi/format_strings
Seiichi Uchida [Tue, 2 Oct 2018 01:29:37 +0000 (10:29 +0900)]
Merge pull request #3073 from scampi/format_strings

format_strings: take into account newline occurring within a rewritten line

5 years agoformat_strings: take into account newline occurring within a rewritten line
Stéphane Campinas [Mon, 1 Oct 2018 22:41:56 +0000 (00:41 +0200)]
format_strings: take into account newline occurring within a rewritten line

5 years agoFormat a paren expr with double slash comment
Seiichi Uchida [Sun, 30 Sep 2018 15:07:18 +0000 (00:07 +0900)]
Format a paren expr with double slash comment

5 years agoAdd a test for #3030
Seiichi Uchida [Sun, 30 Sep 2018 15:06:37 +0000 (00:06 +0900)]
Add a test for #3030

5 years agoConsider a multi-lined array as a block-like expression
Seiichi Uchida [Sun, 30 Sep 2018 14:27:27 +0000 (23:27 +0900)]
Consider a multi-lined array as a block-like expression

5 years agoAdd a test for #3003
Seiichi Uchida [Sun, 30 Sep 2018 14:27:03 +0000 (23:27 +0900)]
Add a test for #3003

and run cargo fmt.

5 years agoUpdate .travis.yml
Seiichi Uchida [Sun, 30 Sep 2018 00:10:52 +0000 (09:10 +0900)]
Update .travis.yml

5 years agoFormat and update test
Seiichi Uchida [Sat, 29 Sep 2018 23:04:34 +0000 (08:04 +0900)]
Format and update test

5 years agoPut arguments of the fail attribute on the same line as println!
Seiichi Uchida [Sat, 29 Sep 2018 23:03:26 +0000 (08:03 +0900)]
Put arguments of the fail attribute on the same line as println!

5 years agoMove maybe_get_args_offset to overflow.rs
Seiichi Uchida [Sat, 29 Sep 2018 23:02:55 +0000 (08:02 +0900)]
Move maybe_get_args_offset to overflow.rs

5 years agoAvoid using to_expr as much as possible
Seiichi Uchida [Sat, 29 Sep 2018 22:10:31 +0000 (07:10 +0900)]
Avoid using to_expr as much as possible

5 years agoGet rid of ToExpr trait
Seiichi Uchida [Sat, 29 Sep 2018 15:26:36 +0000 (00:26 +0900)]
Get rid of ToExpr trait

5 years agoTake impl Iterator for overflow routines
Seiichi Uchida [Sat, 29 Sep 2018 05:33:00 +0000 (14:33 +0900)]
Take impl Iterator for overflow routines

5 years agocomment: Add documentation to `is_doc_comment` public method
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>
5 years agoMerge pull request #3061 from mehcode/feature/default-edition
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

5 years agoMerge pull request #2816 from moxian/enum-discrim
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.

5 years agoFix help message for edition config option
Ryan Leckey [Fri, 28 Sep 2018 05:31:17 +0000 (22:31 -0700)]
Fix help message for edition config option

5 years agoMerge pull request #3050 from andrehjr/empty-impl-body-with-braces-newline
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

5 years agoMerge pull request #3052 from scampi/contributing
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