]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agomove testfiles to "lintcheck" and fix more paths
Matthias Krüger [Tue, 9 Mar 2021 13:40:59 +0000 (14:40 +0100)]
move testfiles to "lintcheck" and fix more paths

3 years agogitignore: add lintchecks target dir
Matthias Krüger [Tue, 9 Mar 2021 13:08:26 +0000 (14:08 +0100)]
gitignore: add lintchecks target dir

3 years agolintcheck: make sure we lauch from the repo root
Matthias Krüger [Tue, 9 Mar 2021 13:06:42 +0000 (14:06 +0100)]
lintcheck: make sure we lauch from the repo root

This will terminate the program if run via "cargo run".
"cargo run" does currently not work because at least a bunch of paths do not take that into account.

3 years agolintcheck: move out of clippy-dev into own crate
Matthias Krüger [Sat, 6 Mar 2021 09:06:52 +0000 (10:06 +0100)]
lintcheck: move out of clippy-dev into own crate

3 years agoAuto merge of #6881 - flip1995:rustup, r=flip1995
bors [Thu, 11 Mar 2021 10:08:29 +0000 (10:08 +0000)]
Auto merge of #6881 - flip1995:rustup, r=flip1995

Rustup

changelog: none

3 years agoFix remaining dogfood errors (internal lints)
flip1995 [Thu, 11 Mar 2021 09:57:49 +0000 (10:57 +0100)]
Fix remaining dogfood errors (internal lints)

3 years agoBump nightly version => 2021-03-11
flip1995 [Thu, 11 Mar 2021 09:38:49 +0000 (10:38 +0100)]
Bump nightly version => 2021-03-11

3 years agoMerge remote-tracking branch 'upstream/master' into rustup
flip1995 [Thu, 11 Mar 2021 09:37:58 +0000 (10:37 +0100)]
Merge remote-tracking branch 'upstream/master' into rustup

3 years agoAuto merge of #6814 - hyd-dev:issue-6486, r=flip1995
bors [Wed, 10 Mar 2021 16:40:33 +0000 (16:40 +0000)]
Auto merge of #6814 - hyd-dev:issue-6486, r=flip1995

Fix false positives on procedural macros of `missing_inline_in_public_items` lint

Fixes #6486.

changelog: Fix false positives on procedural macros of `missing_inline_in_public_items` lint.

3 years agoAuto merge of #6794 - camsteffen:needless-borrowed-ref, r=flip1995
bors [Wed, 10 Mar 2021 16:27:18 +0000 (16:27 +0000)]
Auto merge of #6794 - camsteffen:needless-borrowed-ref, r=flip1995

Improve needless_borrowed_ref docs

changelog: none

I think "borrowed ref" is a confusing description for this lint. Destructuring a reference is the opposite of borrowing. So I updated the wording throughout the docs. Unfortunately this nit applies to the name of the lint itself, but I won't bother changing that. One motivation for these changes is to clarify the difference between this lint and `needless_borrow` (they are actually quite different). Let me know if I need to clarify anything or if you disagree with any changes.

3 years agoAuto merge of #79519 - cjgillot:noattr, r=wesleywiser
bors [Wed, 10 Mar 2021 08:40:51 +0000 (08:40 +0000)]
Auto merge of #79519 - cjgillot:noattr, r=wesleywiser

Store HIR attributes in a side table

Same idea as #72015 but for attributes.
The objective is to reduce incr-comp invalidations due to modified attributes.
Notably, those due to modified doc comments.

Implementation:
- collect attributes during AST->HIR lowering, in `LocalDefId -> ItemLocalId -> &[Attributes]` nested tables;
- access the attributes through a `hir_owner_attrs` query;
- local refactorings to use this access;
- remove `attrs` from HIR data structures one-by-one.

Change in behaviour:
- the HIR visitor traverses all attributes at once instead of parent-by-parent;
- attribute arrays are sometimes duplicated: for statements and variant constructors;
- as a consequence, attributes are marked as used after unused-attribute lint emission to avoid duplicate lints.

~~Current bug: the lint level is not correctly applied in `std::backtrace_rs`, triggering an unused attribute warning on `#![no_std]`. I welcome suggestions.~~

3 years agoAuto merge of #6878 - flip1995:authors, r=Manishearth
bors [Tue, 9 Mar 2021 18:42:09 +0000 (18:42 +0000)]
Auto merge of #6878 - flip1995:authors, r=Manishearth

Set Clippy authors to "The Rust Clippy Developers"

Clippy has grown enough, that putting specific people in the "authors"
field isn't warranted anymore.

As a heads-up: `@Manishearth` `@llogiq` `@birkenfeld` `@mcarton` `@oli-obk` `@phansch` `@matthiaskrgr` your names will be removed from one or more of the `Cargo.toml` files of Clippy. This of course does not mean that we value your previous work on Clippy any less :heart:

As per our discussion in today's meeting: https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Meeting.202021-03-09/near/229502514

changelog: none

3 years agoRemove hir::Expr::attrs.
Camille GILLOT [Fri, 27 Nov 2020 16:41:05 +0000 (17:41 +0100)]
Remove hir::Expr::attrs.

3 years agoRemove hir::Item::attrs.
Camille GILLOT [Sun, 24 Jan 2021 12:17:54 +0000 (13:17 +0100)]
Remove hir::Item::attrs.

3 years agoRemove hir::ImplItem::attrs.
Camille GILLOT [Fri, 27 Nov 2020 08:55:10 +0000 (09:55 +0100)]
Remove hir::ImplItem::attrs.

3 years agoRemove hir::TraitItem::attrs.
Camille GILLOT [Fri, 27 Nov 2020 08:41:53 +0000 (09:41 +0100)]
Remove hir::TraitItem::attrs.

3 years agoRemove hir::StructField::attrs.
Camille GILLOT [Thu, 26 Nov 2020 23:27:34 +0000 (00:27 +0100)]
Remove hir::StructField::attrs.

3 years agoRemove hir::Variant::attrs.
Camille GILLOT [Thu, 26 Nov 2020 23:07:36 +0000 (00:07 +0100)]
Remove hir::Variant::attrs.

3 years agoRemove hir::Arm::attrs.
Camille GILLOT [Thu, 26 Nov 2020 22:46:48 +0000 (23:46 +0100)]
Remove hir::Arm::attrs.

3 years agoRemove hir::Crate::attrs.
Camille GILLOT [Thu, 26 Nov 2020 22:38:53 +0000 (23:38 +0100)]
Remove hir::Crate::attrs.

3 years agoRemove hir::Local::attrs.
Camille GILLOT [Wed, 25 Nov 2020 21:45:24 +0000 (22:45 +0100)]
Remove hir::Local::attrs.

3 years agoRemove hir::StmtKind::attrs.
Camille GILLOT [Wed, 25 Nov 2020 21:07:09 +0000 (22:07 +0100)]
Remove hir::StmtKind::attrs.

3 years agoDo not store attrs in FnKind.
Camille GILLOT [Fri, 27 Nov 2020 08:24:42 +0000 (09:24 +0100)]
Do not store attrs in FnKind.

3 years agoSimplify clippy author.
Camille GILLOT [Sun, 6 Dec 2020 21:00:24 +0000 (22:00 +0100)]
Simplify clippy author.

3 years agoSwitch to changing cp_non_overlap in tform
kadmin [Sat, 23 Jan 2021 08:57:04 +0000 (08:57 +0000)]
Switch to changing cp_non_overlap in tform

It was suggested to lower this in MIR instead of ssa, so do that instead.

3 years agoUpdate cranelift
kadmin [Tue, 29 Dec 2020 02:00:04 +0000 (02:00 +0000)]
Update cranelift

3 years agoUpdate match branches
kadmin [Mon, 5 Oct 2020 22:53:00 +0000 (22:53 +0000)]
Update match branches

This updates all places where match branches check on StatementKind or UseContext.
This doesn't properly implement them, but adds TODOs where they are, and also adds some best
guesses to what they should be in some cases.

3 years agoSet Clippy authors to "The Rust Clippy Developers"
flip1995 [Tue, 9 Mar 2021 16:50:04 +0000 (17:50 +0100)]
Set Clippy authors to "The Rust Clippy Developers"

Clippy has grown enough, that putting specific people in the "authors"
field is warranted anymore.

3 years agoAuto merge of #6876 - giraffate:improve_doc_on_map_flatten, r=flip1995
bors [Tue, 9 Mar 2021 15:18:16 +0000 (15:18 +0000)]
Auto merge of #6876 - giraffate:improve_doc_on_map_flatten, r=flip1995

Improve doc on `map_flatten`

Fix https://github.com/rust-lang/rust-clippy/issues/6870. It's because this doc lacks the description that this lint is also used for `Option`.

changelog: none

3 years agoImprove doc on `map_flatten`
Takayuki Nakata [Tue, 9 Mar 2021 15:02:24 +0000 (00:02 +0900)]
Improve doc on `map_flatten`

3 years agoAuto merge of #6866 - anall:ice6840, r=flip1995
bors [Tue, 9 Mar 2021 14:58:24 +0000 (14:58 +0000)]
Auto merge of #6866 - anall:ice6840, r=flip1995

Fix ICE 6840 - make is_normalizable more strict

fixes #6840

make `is_normalizable` more strict, which should catch this ICE and related cases

changelog: Fix ICE in [`zero_sized_map_values`]

3 years agoadd comment for when can be removed
Andrea Nall [Tue, 9 Mar 2021 14:30:33 +0000 (08:30 -0600)]
add comment for when  can be removed

3 years agoAuto merge of #6868 - Jarcho:lang_item, r=flip1995
bors [Tue, 9 Mar 2021 14:28:49 +0000 (14:28 +0000)]
Auto merge of #6868 - Jarcho:lang_item, r=flip1995

Don't assume lang items will exist.

~~Should fix lintcheck warnings caused by #6823~~
See below

changelog: None

3 years agoAuto merge of #6873 - Y-Nak:refactor-casts-lint, r=flip1995
bors [Tue, 9 Mar 2021 12:43:20 +0000 (12:43 +0000)]
Auto merge of #6873 - Y-Nak:refactor-casts-lint, r=flip1995

Refactor casts lint

Ref: #6724

Changes:
1. Separate the `casts` group from the `types` group.
2. Reorganize the lints of the `casts` group into their own modules.

Notes:
1. I didn't `fix` #6874 in order to maintain this PR as small as possible.

---
changelog: none

3 years agoMove ptr_as_ptr to its own module
Yoshitomo Nakanishi [Tue, 9 Mar 2021 11:04:19 +0000 (20:04 +0900)]
Move ptr_as_ptr to its own module

3 years agoRollup merge of #82048 - mark-i-m:or-pat-type-ascription, r=petrochenkov
Mara Bos [Tue, 9 Mar 2021 09:05:20 +0000 (09:05 +0000)]
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``

3 years agoMove char_lit_as_u8 to its own module
Yoshitomo Nakanishi [Tue, 9 Mar 2021 08:28:56 +0000 (17:28 +0900)]
Move char_lit_as_u8 to its own module

3 years agoMove cast_ref_to_mut to its own module
Yoshitomo Nakanishi [Tue, 9 Mar 2021 08:22:21 +0000 (17:22 +0900)]
Move cast_ref_to_mut to its own module

3 years agoMove cast_ptr_alignment to its own module
Yoshitomo Nakanishi [Tue, 9 Mar 2021 08:15:18 +0000 (17:15 +0900)]
Move cast_ptr_alignment to its own module

3 years agoMove fn_to_numeric_cast_with_truncation to its own module
Yoshitomo Nakanishi [Tue, 9 Mar 2021 08:06:25 +0000 (17:06 +0900)]
Move fn_to_numeric_cast_with_truncation to its own module

3 years agoMove fn_to_numeric_cast to its own module
Yoshitomo Nakanishi [Tue, 9 Mar 2021 08:03:07 +0000 (17:03 +0900)]
Move fn_to_numeric_cast to its own module

3 years agoRemove 'lint_numeric_casts'
Yoshitomo Nakanishi [Tue, 9 Mar 2021 07:47:46 +0000 (16:47 +0900)]
Remove 'lint_numeric_casts'

3 years agoMove unnecessary_cast to its own module
Yoshitomo Nakanishi [Tue, 9 Mar 2021 07:43:10 +0000 (16:43 +0900)]
Move unnecessary_cast to its own module

3 years agoMove cast_possible_wrap to its own module
Yoshitomo Nakanishi [Tue, 9 Mar 2021 07:11:46 +0000 (16:11 +0900)]
Move cast_possible_wrap to its own module

3 years agoMove cast_sign_loss to its own module
Yoshitomo Nakanishi [Tue, 9 Mar 2021 03:37:46 +0000 (12:37 +0900)]
Move cast_sign_loss to its own module

3 years agoMove cast_possible_truncation to its own module
Yoshitomo Nakanishi [Tue, 9 Mar 2021 03:10:59 +0000 (12:10 +0900)]
Move cast_possible_truncation to its own module

3 years agoAuto merge of #6869 - DJMcNab:rust-analyzer-private, r=phansch
bors [Tue, 9 Mar 2021 06:46:55 +0000 (06:46 +0000)]
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.

3 years agouse `.all` instead of negative use of `.any`
Andrea Nall [Tue, 9 Mar 2021 05:08:52 +0000 (23:08 -0600)]
use `.all` instead of negative use of `.any`

3 years agouse TyS::walk
Andrea Nall [Tue, 9 Mar 2021 05:03:45 +0000 (23:03 -0600)]
use TyS::walk

3 years agoMove cast_lossless to its own module
Yoshitomo Nakanishi [Tue, 9 Mar 2021 02:44:52 +0000 (11:44 +0900)]
Move cast_lossless to its own module

3 years agoMove cast_precision_loss to its own module
Yoshitomo Nakanishi [Tue, 9 Mar 2021 02:22:17 +0000 (11:22 +0900)]
Move cast_precision_loss to its own module

3 years agoMove 'is_isize_or_usize' to clippy_utils
Yoshitomo Nakanishi [Tue, 9 Mar 2021 02:08:26 +0000 (11:08 +0900)]
Move 'is_isize_or_usize' to clippy_utils

3 years agoSeparate lints of casts group from types group
Yoshitomo Nakanishi [Tue, 9 Mar 2021 01:57:25 +0000 (10:57 +0900)]
Separate lints of casts group from types group

3 years agoAuto merge of #6871 - camsteffen:redundant-closure-macro, r=Manishearth
bors [Mon, 8 Mar 2021 21:32:21 +0000 (21:32 +0000)]
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)

3 years agoImprove the redundant_closure message
Cameron Steffen [Mon, 8 Mar 2021 19:05:13 +0000 (13:05 -0600)]
Improve the redundant_closure message

3 years agoclippy: fix or-pattern in let binding
mark [Mon, 8 Mar 2021 18:41:28 +0000 (12:41 -0600)]
clippy: fix or-pattern in let binding

3 years agoFix redundant closure with macros
Cameron Steffen [Mon, 8 Mar 2021 18:59:58 +0000 (12:59 -0600)]
Fix redundant closure with macros

3 years agoOpt-in to rustc_private for `rust-analyzer`
Daniel McNab [Mon, 8 Mar 2021 17:39:51 +0000 (17:39 +0000)]
Opt-in to rustc_private for `rust-analyzer`

rust-analyzer/rust-analyzer#7891

3 years agoDon't assume lang items will exist.
Jason Newcomb [Mon, 8 Mar 2021 16:08:52 +0000 (11:08 -0500)]
Don't assume lang items will exist.

3 years agoAuto merge of #6725 - Y-Nak:refactor-types-lints, r=flip1995
bors [Mon, 8 Mar 2021 16:03:20 +0000 (16:03 +0000)]
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

3 years agoFix some lints in types that fail dogfood
Yoshitomo Nakanishi [Thu, 25 Feb 2021 16:06:15 +0000 (01:06 +0900)]
Fix some lints in types that fail dogfood

3 years agoImport declared lints at the top of the file
Yoshitomo Nakanishi [Tue, 16 Feb 2021 13:18:53 +0000 (22:18 +0900)]
Import declared lints at the top of the file

3 years agoRemove unused is_local from borrowed_box
Yoshitomo Nakanishi [Fri, 12 Feb 2021 06:26:36 +0000 (15:26 +0900)]
Remove unused is_local from borrowed_box

3 years agoMove borrowed_box to its own module
Yoshitomo Nakanishi [Fri, 12 Feb 2021 06:22:07 +0000 (15:22 +0900)]
Move borrowed_box to its own module

3 years agoMove linked_list to its own module
Yoshitomo Nakanishi [Fri, 12 Feb 2021 05:28:17 +0000 (14:28 +0900)]
Move linked_list to its own module

3 years agoMove option_option to its own module
Yoshitomo Nakanishi [Fri, 12 Feb 2021 05:24:02 +0000 (14:24 +0900)]
Move option_option to its own module

3 years agoAdd flags to detect lints are triggered
Yoshitomo Nakanishi [Fri, 12 Feb 2021 05:11:04 +0000 (14:11 +0900)]
Add flags to detect lints are triggered

3 years agoMove vec_box to its own module
Yoshitomo Nakanishi [Fri, 12 Feb 2021 05:00:17 +0000 (14:00 +0900)]
Move vec_box to its own module

3 years agoMove rc_buffer to its own module
Yoshitomo Nakanishi [Fri, 12 Feb 2021 03:09:36 +0000 (12:09 +0900)]
Move rc_buffer to its own module

3 years agoMove redundant_allocation to its own module
Yoshitomo Nakanishi [Thu, 11 Feb 2021 08:41:14 +0000 (17:41 +0900)]
Move redundant_allocation to its own module

3 years agoMove box_vec to its own module
Yoshitomo Nakanishi [Thu, 11 Feb 2021 08:32:46 +0000 (17:32 +0900)]
Move box_vec to its own module

3 years agoCreate types dir and move old module under it
Yoshitomo Nakanishi [Thu, 11 Feb 2021 04:54:35 +0000 (13:54 +0900)]
Create types dir and move old module under it

3 years agoAuto merge of #6834 - hyd-dev:clippy-args, r=phansch,flip1995,oli-obk
bors [Mon, 8 Mar 2021 13:18:39 +0000 (13:18 +0000)]
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.

3 years agoDon't panic if `CLIPPY_ARGS` is not Unicode
hyd-dev [Mon, 8 Mar 2021 10:49:41 +0000 (18:49 +0800)]
Don't panic if `CLIPPY_ARGS` is not Unicode

3 years agoMove `test_no_deps_ignores_path_deps_in_workspaces()` out of `dogfood_subprojects()`
hyd-dev [Mon, 8 Mar 2021 10:29:36 +0000 (18:29 +0800)]
Move `test_no_deps_ignores_path_deps_in_workspaces()` out of `dogfood_subprojects()`

3 years agoRename `ClippyArgsCallbacks` to `RustcCallbacks`
hyd-dev [Mon, 8 Mar 2021 10:28:43 +0000 (18:28 +0800)]
Rename `ClippyArgsCallbacks` to `RustcCallbacks`

3 years agoAuto merge of #82727 - oli-obk:shrinkmem, r=pnkfelix
bors [Mon, 8 Mar 2021 08:39:24 +0000 (08:39 +0000)]
Auto merge of #82727 - oli-obk:shrinkmem, r=pnkfelix

Test the effect of shrinking the size of Rvalue by 16 bytes

r? `@ghost`

3 years agoAuto merge of #6864 - giraffate:fix_doc_adding_a_new_lint, r=Manishearth
bors [Mon, 8 Mar 2021 03:54:32 +0000 (03:54 +0000)]
Auto merge of #6864 - giraffate:fix_doc_adding_a_new_lint, r=Manishearth

Add msrv to contents in adding lints md

changelog: none

3 years agomake is_normalizable more strict
Andrea Nall [Mon, 8 Mar 2021 03:45:41 +0000 (21:45 -0600)]
make is_normalizable more strict

3 years agoAdd msrv to contents in adding lints md
Takayuki Nakata [Mon, 8 Mar 2021 00:27:59 +0000 (09:27 +0900)]
Add msrv to contents in adding lints md

3 years agoAuto merge of #6807 - anall:feature/use_new_diagnostics, r=Manishearth
bors [Mon, 8 Mar 2021 00:04:48 +0000 (00:04 +0000)]
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

3 years agorelocate functions from `clippy_lints::types`
Andrea Nall [Sun, 7 Mar 2021 23:58:39 +0000 (17:58 -0600)]
relocate functions from `clippy_lints::types`

relocate `is_ty_param_lang_item` and `is_ty_param_diagnostic_item` to `clippy_utils`

3 years agomigrate paths to newly-added diagnostic items
Andrea Nall [Sat, 27 Feb 2021 01:10:17 +0000 (19:10 -0600)]
migrate paths to newly-added diagnostic items

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

Also removes some usages of:
  * PATH_BUF

And the now completely unused `clippy_lints::types::is_ty_param_path`

3 years agoAuto merge of #6853 - Jarcho:len_without_is_empty_fp, r=Manishearth
bors [Sun, 7 Mar 2021 22:58:11 +0000 (22:58 +0000)]
Auto merge of #6853 - Jarcho:len_without_is_empty_fp, r=Manishearth

`len_without_is_empty` will now consider multiple impl blocks

fixes #1562

This also reverts #1559 as the `#[allow]` now works on the `len` method. A note has also been added to point out where the `empty` method is, if it exists.

changelog: `len_without_is_empty` will now consider multiple impl blocks
changelog: `len_without_is_empty` will now consider `#[allow]` on both the `len` method, and the type definition

3 years ago`len_without_is_empty` will now consider multiple impl blocks
Jason Newcomb [Fri, 5 Mar 2021 18:01:13 +0000 (13:01 -0500)]
`len_without_is_empty` will now consider multiple impl blocks
`len_without_is_empty` will now consider `#[allow]` on both the `len` method, and the type definition

3 years agoAuto merge of #6823 - Jarcho:diagnostic_items, r=phansch
bors [Sun, 7 Mar 2021 12:04:42 +0000 (12:04 +0000)]
Auto merge of #6823 - Jarcho:diagnostic_items, r=phansch

Use diagnostic or language items instead of paths

I think that gets everything except ones used in a list of paths to check.

changelog: none

3 years agoUse `LanguageItems::require`
Jason Newcomb [Tue, 2 Mar 2021 18:06:30 +0000 (13:06 -0500)]
Use `LanguageItems::require`

3 years agoAuto merge of #6854 - mgacek8:6844_fix_doc_for_useless_format_lint, r=phansch
bors [Sat, 6 Mar 2021 13:32:04 +0000 (13:32 +0000)]
Auto merge of #6854 - mgacek8:6844_fix_doc_for_useless_format_lint, r=phansch

useless_format: fix examples in the description

fixes #6844
changelog: useless_format: fix examples in the description

3 years agoAuto merge of #6848 - matthiaskrgr:lintcheck_clippyfix, r=llogiq
bors [Fri, 5 Mar 2021 21:10:52 +0000 (21:10 +0000)]
Auto merge of #6848 - matthiaskrgr:lintcheck_clippyfix, r=llogiq

lintcheck: add --fix mode which tries to apply lint suggestions to th…

…e sources and prints a warning if that fails

Great for spotting false positives/broken suggestions of applicable lints.

There are false positives though because I'm not sure yet how to silence rustc warnings while keeping clippy warnings.
Sometimes rustc makes a suggestion that fails to apply and the implementation does not differentiate between clippy and rustc warnings when applying lint suggestions.

changelog: none

3 years agoRollup merge of #82736 - spastorino:mir-opt-level-perf-changes, r=oli-obk
Guillaume Gomez [Fri, 5 Mar 2021 20:44:40 +0000 (21:44 +0100)]
Rollup merge of #82736 - spastorino:mir-opt-level-perf-changes, r=oli-obk

Bump optimization from mir_opt_level 2 to 3 and 3 to 4 and make "release" be level 2 by default

r? `@oli-obk`

3 years agoMake clippy set mir_opt_level using Option
Santiago Pastorino [Thu, 4 Mar 2021 02:33:18 +0000 (23:33 -0300)]
Make clippy set mir_opt_level using Option

3 years agouseless_format: fix examples in the description
Mateusz Gacek [Fri, 5 Mar 2021 20:11:31 +0000 (12:11 -0800)]
useless_format: fix examples in the description

"Good" example was something not acceptable by the useless_format lint.

3 years agoAuto merge of #6852 - camsteffen:avoid-mir, r=Manishearth
bors [Fri, 5 Mar 2021 17:30:43 +0000 (17:30 +0000)]
Auto merge of #6852 - camsteffen:avoid-mir, r=Manishearth

Remove a couple MIR usages

changelog: none

We use MIR to get the return type of a closure/function in a couple places. But typeck seems like a better approach.

This is the easy part of #6080.

Also did a tiny cleanup with `typeck` -> `typeck_body`.

3 years agoUse typeck_body
Cameron Steffen [Fri, 5 Mar 2021 16:35:39 +0000 (10:35 -0600)]
Use typeck_body

3 years agoAvoid mir in missing_errors_doc
Cameron Steffen [Fri, 5 Mar 2021 16:32:15 +0000 (10:32 -0600)]
Avoid mir in missing_errors_doc

3 years agoAvoid mir in implicit_return
Cameron Steffen [Fri, 5 Mar 2021 16:13:59 +0000 (10:13 -0600)]
Avoid mir in implicit_return

3 years agolintcheck: add --fix mode which tries to apply lint suggestions to the sources and...
Matthias Krüger [Fri, 5 Mar 2021 08:30:12 +0000 (09:30 +0100)]
lintcheck: add --fix mode which tries to apply lint suggestions to the sources and prints a warning if that fails

Great for spotting false positives/broken suggestions of applicable lints.

There are false positives though becasue I'm not sure yet how to silence rustc warnings while keeping clippy warnings.
Sometimes rustc makes a suggestion that fails to apply and the implementation does not differenciate between clippy and rustc warnings when applying lint suggestions.

changelog: none

3 years agoAuto merge of #6849 - flip1995:dogfood-fix, r=matthiaskrgr
bors [Fri, 5 Mar 2021 14:09:24 +0000 (14:09 +0000)]
Auto merge of #6849 - flip1995:dogfood-fix, r=matthiaskrgr

Dogfood and CI fixes

The CI fix is practically #6829 rebased and squashed into one commit

Dogfood fix is a follow up of #6802

r? `@matthiaskrgr` for lintcheck changes

(best reviewed with whitespace changes hidden)

changelog: none

3 years agoExtract directory creation into its own function
flip1995 [Fri, 5 Mar 2021 13:06:43 +0000 (14:06 +0100)]
Extract directory creation into its own function

3 years agoFix dogfood errors in clippy_dev
flip1995 [Fri, 5 Mar 2021 10:10:15 +0000 (11:10 +0100)]
Fix dogfood errors in clippy_dev