Commit Graph

7708 Commits

Author SHA1 Message Date
flip1995
f940b04de6
Fix run-pass tests when CARGO_TARGET_DIR is not set 2020-02-10 15:51:51 +01:00
bors
c066807a70 Auto merge of #5148 - krishna-veerareddy:issue-5147-option-env-unwrap, r=flip1995
Add `option-env-unwrap` lint

changelog: Add `option-env-unwrap` lint

Fixes #5147
2020-02-10 08:08:53 +00:00
Krishna Sai Veera Reddy
b48b221f80 Use PATH environment variable for testing
The tests were failing on windows because the `HOME` env variable
doesn't exist on it so using the `PATH` variable to test instead.
2020-02-09 15:35:51 -08:00
bors
701a5791ac Auto merge of #5150 - krishna-veerareddy:rustup-69004, r=flip1995
Rustup to rust-lang/rust#68911

changelog: none
2020-02-09 22:59:08 +00:00
Krishna Sai Veera Reddy
46bd185e32 Rustup to rust-lang/rust#68911 2020-02-09 14:44:17 -08:00
Krishna Sai Veera Reddy
a3a1587a1c Allow option-env-unwrap within external macros 2020-02-09 10:58:08 -08:00
Krishna Sai Veera Reddy
0e5ba2f0e7 Account for expect being used to unwrap Option 2020-02-09 08:54:23 -08:00
bors
ab0cb309e2 Auto merge of #5145 - lzutao:rmeta, r=flip1995
Fix error E0460 when compiled on Rustc repo

Sadly, this mostly reverts  #5121. Now I use HashMap to only store one rlib
per crate. But that would not work when non-compatible version of the same crate show up.

changelog: none
2020-02-09 12:44:23 +00:00
Lzu Tao
9eb913a7e2 Fix error E0460 when compiled on Rustc repo 2020-02-09 19:02:27 +07:00
bors
2d9ef4e9f9 Auto merge of #5149 - lzutao:rustup-65232, r=flip1995
Rustup "index ReEmpty by universe"

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

changelog: none
2020-02-09 11:08:43 +00:00
Lzu Tao
5328b5d667 Rustup "index ReEmpty by universe" 2020-02-09 15:31:47 +07:00
Krishna Sai Veera Reddy
be1bc571c3 Add option-env-unwrap lint 2020-02-08 16:44:35 -08:00
bors
4ad6fb3fb0 Auto merge of #5140 - lzutao:cleanup-replace, r=flip1995
Minor edit to text region replacement

changelog: none
2020-02-07 22:41:04 +00:00
bors
550affd763 Auto merge of #5146 - lzutao:rustup, r=flip1995
Rustup https://github.com/rust-lang/rust/pull/67359

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

changelog: none
2020-02-07 08:28:41 +00:00
Lzu Tao
9a12baad35 Update CARGO_TARGET_DIR 2020-02-07 14:41:04 +07:00
Lzu Tao
c6a4beaf56 Rustup https://github.com/rust-lang/rust/pull/67359 2020-02-07 10:40:09 +07:00
Lzu Tao
cf58537bd6 dev: Move DOCS_LINK out of lazy_static and reuse it 2020-02-07 08:33:05 +07:00
Lzu Tao
344603afce dev: Make UpdateMode a copy type 2020-02-07 08:33:05 +07:00
Lzu Tao
729f943c53 dev: Prefer fs::read* and improvement to replace text region 2020-02-07 08:33:05 +07:00
bors
b5e6d6db41 Auto merge of #5134 - flip1995:snippet_block, r=phansch
Make it possible to correctly indent snippet_block snippets

This adds a `indent_relative_to` arg to the `{snippet,expr}_block` functions. This makes it possible to keep the correct indentation of block like suggestions.

In addition, this makes the `trim_multiline` function private and adds a `indent_of` function, to get the indentation of the first line of a span.

The suggestion of `needless_continue` cannot be made auto applicable, since it would be also necessary to remove code following the linted expression. (Well, maybe it is possible, but I don't know how to do it. Expanding the suggestion span to the last expression, that should be removed didn't work)

changelog: Improve suggestions, when blocks of code are involved
2020-02-06 21:41:50 +00:00
bors
ee842df61d Auto merge of #5143 - flip1995:rustup, r=flip1995
Rustup to rust-lang/rust#68788

cc rust-lang/rust#68901

changelog: none
2020-02-06 20:53:17 +00:00
flip1995
9897927504
Rustup to rust-lang/rust#68788 2020-02-06 20:33:39 +01:00
flip1995
e23881e131
Rename ctx->cx in needless_continue 2020-02-06 19:15:01 +01:00
flip1995
4068ff4d8a
Improve help message in needless_continue 2020-02-06 19:15:01 +01:00
flip1995
c7979d3515
Fix rebase fallout 2020-02-06 19:15:01 +01:00
flip1995
250c1842b1
Document the indent_relative_to arg of snippet_block 2020-02-06 19:15:01 +01:00
flip1995
7363728d18
Update remaining test files 2020-02-06 19:15:01 +01:00
flip1995
cd0f0946cf
Move tests to the end of the file in utils mod.rs 2020-02-06 19:15:00 +01:00
flip1995
f1a72e992d
Update needless_continue stderr 2020-02-06 19:13:46 +01:00
flip1995
8e15985827
Rewrite suggestion generation of needless_continue 2020-02-06 19:13:46 +01:00
flip1995
10cd1662c1
Update block_in_if_condition test files 2020-02-06 19:13:46 +01:00
flip1995
19f08c200e
Make block_in_if_condition auto applicable 2020-02-06 19:13:46 +01:00
flip1995
5fd22b3f93
Optionally indent snippet_block relative to an Expr 2020-02-06 19:13:45 +01:00
bors
a6f310ed0e Auto merge of #5139 - lzutao:linecount, r=llogiq
dev: Use bytecount for faster line count

changelog: none
2020-02-06 15:31:01 +00:00
bors
75e983a518 Auto merge of #5125 - Areredify:too_many_bools, r=flip1995
Port mitsuhiko's excessive bools lints

Closes #4 .
changelog: add `struct_excessive_bools` and `fn_params_excessive_bools` lints.
I moved is_trait_impl_item check because at first I implemented it as a late pass for some reason but then I realized it's actually an early lint. But it's a useful function to have, should I move it into a separate pr?
2020-02-06 14:47:14 +00:00
Lzu Tao
8794e41728 dev: Use bytecount for faster line count 2020-02-06 21:39:15 +07:00
bors
a3135ba131 Auto merge of #5132 - JohnTitor:fix-fp-in-unwrap-lint, r=flip1995
Do not lint `unnecessary_unwrap` in external macros

Fixes #5131

I think we shouldn't lint `{panicking, unnecessary}_unwrap` in macros, not just `assert!`.

changelog: Fix false positive in `unnecessary_unwrap`
2020-02-06 14:17:35 +00:00
bors
c1f8be074e Auto merge of #5121 - lzutao:comptest, r=flip1995
Improve compile_test and dogfood tests

* Hopefully this finally resolves the "multiple matching crates" error, e.g. #4015
* This handle some convenient CARGO env like CARGO_TARGET_DIR and CARGO_BUILD_TARGET

changelog: none
2020-02-06 09:19:29 +00:00
Areredify
338fb7a3e9 add excessive bools lints 2020-02-05 20:54:58 +03:00
Lzu Tao
c4b4dd200c Use lazy_static 2020-02-05 16:13:55 +01:00
Areredify
8e28b2fdf1 move is_trait_impl_item check from functions.rs to utils 2020-02-05 18:11:20 +03:00
Lzu Tao
3485d22139 Add serde_derive to the need-to-be-disambiguated-crates list 2020-02-05 22:00:19 +07:00
Lzu Tao
47abd0a217 Fix dogfood to use cargo mod too 2020-02-05 21:55:03 +07:00
Lzu Tao
4c2a5f857a compile-test: Handle CARGO_TARGET_DIR and transitive deps 2020-02-05 21:55:03 +07:00
bors
a7b3b9f553 Auto merge of #5137 - lzutao:race, r=flip1995
Prevent failing to restart setup-toolchain

If `rustup-toolchain-install-master` fails to install master
toolchain (in case `rustup update` executes at the same remove the
tmp directory), `cargo search` (which use master toolchain after
`rustup override` command) will fail. This leads to setup-toolchain
fails too.

changelog: none
2020-02-05 14:16:17 +00:00
Lzu Tao
46df9716af Prevent failing to restart setup-toolchain
If `rustup-toolchain-install-master` fails to install master
toolchain (in case `rustup update` executes at the same remove the
tmp directory), `cargo search` (which use master toolchain after
`rustup override` command) will fail. This leads to setup-toolchain
fails too.
2020-02-05 20:37:33 +07:00
bors
c881aca282 Auto merge of #5135 - lzutao:config, r=flip1995
Few improvement to `utils::conf` module

* Fix a few typos
* Handle Option<&Path> early
* Use `env::var_os` when possible

changelog: none
2020-02-05 09:58:15 +00:00
Lzu Tao
32924c6ce0 Few improvement to utils::conf module
* Fix a few typos
* Handle Option<&Path> early
* Use `env::var_os` when possible
2020-02-05 09:06:34 +07:00
bors
298df70368 Auto merge of #5061 - ThibsG:UselessMatch3664, r=flip1995
Add new lint: match with a single binding statement

This lint catches `match` statements that binds to only one block and could be rewritten using a simple `let` statement.

Lint name: MATCH_SINGLE_BINDING

fixes: #3664

changelog: add lint for match with single binding statement
2020-02-04 22:16:13 +00:00
ThibsG
00904cb100 Manage macros case + move to MaybeIncorrect when binding values 2020-02-04 22:54:42 +01:00