Commit Graph

11328 Commits

Author SHA1 Message Date
Yoshitomo Nakanishi
9e631da454 Move ptr_as_ptr to its own module 2021-03-09 20:18:25 +09:00
Mara Bos
824662d78a Rollup merge of #82048 - mark-i-m:or-pat-type-ascription, r=petrochenkov
or-patterns: disallow in `let` bindings

~~Blocked on https://github.com/rust-lang/rust/pull/81869~~

Disallows top-level or-patterns before type ascription. We want to reserve this syntactic space for possible future generalized type ascription.

r? ``@petrochenkov``
2021-03-09 09:05:20 +00:00
Yoshitomo Nakanishi
43c88c60c1 Move char_lit_as_u8 to its own module 2021-03-09 17:28:56 +09:00
Yoshitomo Nakanishi
f33bb3d900 Move cast_ref_to_mut to its own module 2021-03-09 17:24:29 +09:00
Yoshitomo Nakanishi
ebd1ec0e40 Move cast_ptr_alignment to its own module 2021-03-09 17:17:04 +09:00
Yoshitomo Nakanishi
9a24877e2c Move fn_to_numeric_cast_with_truncation to its own module 2021-03-09 17:16:10 +09:00
Yoshitomo Nakanishi
458f6d19d0 Move fn_to_numeric_cast to its own module 2021-03-09 17:16:10 +09:00
Yoshitomo Nakanishi
0dce9921fd Remove 'lint_numeric_casts' 2021-03-09 17:16:10 +09:00
Yoshitomo Nakanishi
9709993e41 Move unnecessary_cast to its own module 2021-03-09 17:16:07 +09:00
Yoshitomo Nakanishi
a383e034dc Move cast_possible_wrap to its own module 2021-03-09 16:44:44 +09:00
Yoshitomo Nakanishi
0975031117 Move cast_sign_loss to its own module 2021-03-09 16:05:21 +09:00
Yoshitomo Nakanishi
0534bf4698 Move cast_possible_truncation to its own module 2021-03-09 16:05:20 +09:00
bors
727e5f133c Auto merge of #6869 - DJMcNab:rust-analyzer-private, r=phansch
Opt-in to rustc_private for `rust-analyzer`

rust-analyzer/rust-analyzer#7891

changelog: none

This will also help priroda and any other package which depends on the `miri` library crate.
2021-03-09 06:46:55 +00:00
Andrea Nall
e812a8abde use .all instead of negative use of .any 2021-03-08 23:08:52 -06:00
Andrea Nall
e322c773e3 use TyS::walk 2021-03-08 23:03:45 -06:00
Yoshitomo Nakanishi
b12d7515b1 Move cast_lossless to its own module 2021-03-09 12:39:59 +09:00
Yoshitomo Nakanishi
c2cbcd3229 Move cast_precision_loss to its own module 2021-03-09 11:22:17 +09:00
Yoshitomo Nakanishi
360f065404 Move 'is_isize_or_usize' to clippy_utils 2021-03-09 11:08:45 +09:00
Yoshitomo Nakanishi
f098007caa Separate lints of casts group from types group 2021-03-09 10:57:32 +09:00
bors
2cb5bbf80c Auto merge of #6871 - camsteffen:redundant-closure-macro, r=Manishearth
Fix redundant closure with macros

changelog: Fix redundant_closure FPs with macros

Fixes #6732
Fixes #6850
Fixes #4354 (addresses the error message confusion)
2021-03-08 21:32:21 +00:00
Cameron Steffen
8c540dcd2d Improve the redundant_closure message 2021-03-08 13:16:53 -06:00
mark
7e4f5ca38e clippy: fix or-pattern in let binding 2021-03-08 13:16:00 -06:00
Cameron Steffen
bf98aa6fb8 Fix redundant closure with macros 2021-03-08 13:15:13 -06:00
Daniel McNab
c4e2cf9601 Opt-in to rustc_private for rust-analyzer
rust-analyzer/rust-analyzer#7891
2021-03-08 17:39:51 +00:00
Jason Newcomb
f2d917e3b1
Don't assume lang items will exist. 2021-03-08 11:08:52 -05:00
bors
b207f23cd1 Auto merge of #6725 - Y-Nak:refactor-types-lints, r=flip1995
Refactor types lints

Ref #6724.
As described in #6724, `types.rs` contains many groups inside it.
In this PR, I reorganize the lints of the `types` group into their own modules.

changelog: none
2021-03-08 16:03:20 +00:00
Yoshitomo Nakanishi
db59c35b7e Fix some lints in types that fail dogfood 2021-03-09 00:52:25 +09:00
Yoshitomo Nakanishi
bb8208da2b Import declared lints at the top of the file 2021-03-09 00:51:06 +09:00
Yoshitomo Nakanishi
2afa7df564 Remove unused is_local from borrowed_box 2021-03-09 00:50:22 +09:00
Yoshitomo Nakanishi
53d3ffe539 Move borrowed_box to its own module 2021-03-09 00:50:22 +09:00
Yoshitomo Nakanishi
cc3ab1c0ec Move linked_list to its own module 2021-03-09 00:50:22 +09:00
Yoshitomo Nakanishi
b59c879fc9 Move option_option to its own module 2021-03-09 00:49:04 +09:00
Yoshitomo Nakanishi
fbd25e93a4 Add flags to detect lints are triggered 2021-03-09 00:49:04 +09:00
Yoshitomo Nakanishi
2c2fb3996f Move vec_box to its own module 2021-03-09 00:47:30 +09:00
Yoshitomo Nakanishi
f110c5e6f5 Move rc_buffer to its own module 2021-03-09 00:46:28 +09:00
Yoshitomo Nakanishi
128f1f5e2e Move redundant_allocation to its own module 2021-03-09 00:40:47 +09:00
Yoshitomo Nakanishi
df307c0ce7 Move box_vec to its own module 2021-03-09 00:36:46 +09:00
Yoshitomo Nakanishi
714a826439 Create types dir and move old module under it 2021-03-09 00:33:22 +09:00
Yusuke Tanaka
0327c2e041
Output help instead of suggestion in if_then_some_else_none diagnose 2021-03-08 23:20:18 +09:00
Yusuke Tanaka
f2a85cb42a
Set 1.50 as msrv of if_then_some_else_none 2021-03-08 22:52:03 +09:00
bors
d0d5232c72 Auto merge of #6834 - hyd-dev:clippy-args, r=phansch,flip1995,oli-obk
Let Cargo track CLIPPY_ARGS

This PR makes `clippy-driver` emit `CLIPPY_ARGS` in its `dep-info` output.

Just like #6441, this allows this workflow to work:
```shell
cargo clippy # warning: empty `loop {}` wastes CPU cycles
cargo clippy -- -A clippy::empty_loop # no warnings emitted
```
But without rebuilding all dependencies.

cc https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/CLIPPY_ARGS.20is.20not.20tracked.20by.20Cargo/near/228599088

changelog: Cargo now re-runs Clippy if arguments after `--` provided to `cargo clippy` are changed.
2021-03-08 13:18:39 +00:00
hyd-dev
3cd5f44ec4
Don't panic if CLIPPY_ARGS is not Unicode 2021-03-08 18:50:08 +08:00
hyd-dev
2d53b6b824
Move test_no_deps_ignores_path_deps_in_workspaces() out of dogfood_subprojects() 2021-03-08 18:29:36 +08:00
hyd-dev
2d07c33c86
Rename ClippyArgsCallbacks to RustcCallbacks 2021-03-08 18:28:43 +08:00
bors
f3b68d307a Auto merge of #82727 - oli-obk:shrinkmem, r=pnkfelix
Test the effect of shrinking the size of Rvalue by 16 bytes

r? `@ghost`
2021-03-08 08:39:24 +00:00
bors
e6c643f399 Auto merge of #6864 - giraffate:fix_doc_adding_a_new_lint, r=Manishearth
Add msrv to contents in adding lints md

changelog: none
2021-03-08 03:54:32 +00:00
Andrea Nall
b27cbda32b make is_normalizable more strict 2021-03-07 21:45:54 -06:00
Takayuki Nakata
06fe44e721 Add msrv to contents in adding lints md 2021-03-08 09:27:59 +09:00
bors
d02ca3b81b Auto merge of #6807 - anall:feature/use_new_diagnostics, r=Manishearth
migrate paths to newly-added diagnostic items

This gets rid of the following paths:
  * OS_STRING
  * TO_OWNED
  * TO_STRING

Removes some usages of:
 * PATH_BUF

Per #5393

also removes unneeded `is_ty_param_path` from `clippy_lints::types` and relocates `is_ty_param_lang_item` and `is_ty_param_diagnostic_item` to `clippy_utils`.

changelog: none
2021-03-08 00:04:48 +00:00
Andrea Nall
9bdc273f03 relocate functions from clippy_lints::types
relocate `is_ty_param_lang_item` and `is_ty_param_diagnostic_item` to `clippy_utils`
2021-03-07 17:58:39 -06:00