]> git.lizzy.rs Git - rust.git/log
rust.git
23 months agoAuto merge of #9270 - schubart:link_to_developer_guide, r=xFrednet
bors [Mon, 1 Aug 2022 08:11:50 +0000 (08:11 +0000)]
Auto merge of #9270 - schubart:link_to_developer_guide, r=xFrednet

Make it easier to find the developer guide

changelog: none

23 months agoMake it easier to find the developer guide
Michael Schubart [Sun, 31 Jul 2022 22:16:23 +0000 (23:16 +0100)]
Make it easier to find the developer guide

Adding the link that I wish had been there when I first looked for
this info.

23 months agoAuto merge of #9223 - sgued:unwrap-expect-used, r=giraffate
bors [Mon, 1 Aug 2022 01:27:03 +0000 (01:27 +0000)]
Auto merge of #9223 - sgued:unwrap-expect-used, r=giraffate

unwrap_used: Don't recommend using `expect` when the `expect_used` lint is not allowed

Fixes #9222

```
changelog: [`unwrap_used`]: Don't recommend using `expect` when the `expect_used` lint is not allowed
```

23 months agoApply suggestions from code review
Sosthene [Sat, 30 Jul 2022 11:17:51 +0000 (13:17 +0200)]
Apply suggestions from code review

The expect_used lint is allow-by-default, so it would be better to show the case where this is enabled.

Co-authored-by: Takayuki Nakata <f.seasons017@gmail.com>
23 months agoAuto merge of #8974 - Metaswitch:remove-blacklist-terminology, r=Manishearth
bors [Fri, 29 Jul 2022 19:12:49 +0000 (19:12 +0000)]
Auto merge of #8974 - Metaswitch:remove-blacklist-terminology, r=Manishearth

Remove "blacklist" terminology

Picking up where https://github.com/rust-lang/rust-clippy/pull/5896 left off, this renames the `blacklisted_name` lint to `disallowed_names` (pluralised for compliance with naming conventions).  The old name is still available though is deprecated (both in the lint name, and in the TOML configuration file).

This has been proposed/requested a few times, most recently in https://github.com/rust-lang/rust-clippy/issues/7582 where `@xFrednet` suggested pinging the Clippy team when a PR was created hence...

cc: `@rust-lang/clippy`

changelog: [`disallowed_names`] lint replaces `blacklisted_name`

23 months agoAdd deprecation test for old configuration entry
Andy Caldwell [Thu, 9 Jun 2022 15:11:19 +0000 (16:11 +0100)]
Add deprecation test for old configuration entry

23 months agoChange lint name to plural
Andy Caldwell [Wed, 8 Jun 2022 19:08:37 +0000 (20:08 +0100)]
Change lint name to plural

23 months agoRename "blacklisted name" to "disallowed name" throughout
Andy Caldwell [Wed, 8 Jun 2022 15:20:30 +0000 (16:20 +0100)]
Rename "blacklisted name" to "disallowed name" throughout

23 months agoAuto merge of #9252 - Metaswitch:use-deprecated-config, r=Jarcho
bors [Fri, 29 Jul 2022 00:54:10 +0000 (00:54 +0000)]
Auto merge of #9252 - Metaswitch:use-deprecated-config, r=Jarcho

Read and use deprecated configuration (as well as emitting a warning)

Original change written by `@flip1995` I've simply rebased to master and fixed up the formatting/tests.  This change teaches the configuration parser which config key replaced a deprecated key and attempts to populate the latter from the former.  If both keys are provided this fails with a duplicate key error (rather than attempting to guess which the user intended).

Currently this on affects `cyclomatic-complexity-threshold` -> `cognitive-complexity-threshold` but will also be used in #8974 to handle `blacklisted-names` -> `disallowed-names`.

```
changelog: deprecated configuration keys are still applied as if they were provided as their non-deprecated name.
```

- [x] `cargo test` passes locally
- [x] Run `cargo dev fmt`

23 months agoHarden duplicates checking and add tests
Andy Caldwell [Thu, 28 Jul 2022 22:05:24 +0000 (23:05 +0100)]
Harden duplicates checking and add tests

23 months agoFix tests
Sosthène Guédon [Thu, 28 Jul 2022 20:27:50 +0000 (22:27 +0200)]
Fix tests

23 months agounwrap_used: Fix doc to not recommend expect when expect_used is not allowed
Sosthène Guédon [Thu, 28 Jul 2022 20:08:48 +0000 (22:08 +0200)]
unwrap_used: Fix doc to not recommend expect when expect_used is not allowed

23 months agoAuto merge of #9257 - flip1995:rustup, r=flip1995
bors [Thu, 28 Jul 2022 16:56:38 +0000 (16:56 +0000)]
Auto merge of #9257 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

changelog: none

23 months agoBump nightly version -> 2022-07-28
Philipp Krones [Thu, 28 Jul 2022 16:56:16 +0000 (18:56 +0200)]
Bump nightly version -> 2022-07-28

23 months agoMerge remote-tracking branch 'upstream/master' into rustup
Philipp Krones [Thu, 28 Jul 2022 16:47:48 +0000 (18:47 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup

23 months agoAuto merge of #9253 - Serial-ATA:fix-fmt-err, r=flip1995
bors [Thu, 28 Jul 2022 07:54:15 +0000 (07:54 +0000)]
Auto merge of #9253 - Serial-ATA:fix-fmt-err, r=flip1995

Tell the user how to revert `dev setup intellij`

changelog: none

23 months agoTell the user how to revert `dev setup intellij`
Serial [Thu, 28 Jul 2022 07:40:21 +0000 (03:40 -0400)]
Tell the user how to revert `dev setup intellij`

23 months agoAuto merge of #9182 - Serial-ATA:new_lint-type-flag, r=xFrednet
bors [Wed, 27 Jul 2022 22:17:29 +0000 (22:17 +0000)]
Auto merge of #9182 - Serial-ATA:new_lint-type-flag, r=xFrednet

Add `--type` flag to `dev new_lint`

changelog: none

This only works with directories, `--type={copies, doc, ...}` won't work. Should they be counted?

23 months agoDocument `--type` flag
Serial [Wed, 27 Jul 2022 00:23:50 +0000 (20:23 -0400)]
Document `--type` flag

23 months agoRead and use deprecated configuration (as well as emitting a warning)
Philipp Krones [Wed, 27 Jul 2022 16:18:20 +0000 (17:18 +0100)]
Read and use deprecated configuration (as well as emitting a warning)

Co-authored-by: Andy Caldwell <andycaldwell@microsoft.com>
23 months agoRollup merge of #99728 - cjgillot:ast-lifetimes-anon-clean, r=petrochenkov
Guillaume Gomez [Wed, 27 Jul 2022 15:55:07 +0000 (17:55 +0200)]
Rollup merge of #99728 - cjgillot:ast-lifetimes-anon-clean, r=petrochenkov

Clean up HIR-based lifetime resolution

Based on https://github.com/rust-lang/rust/pull/97313.

Fixes #98932.

r? `@petrochenkov`

23 months agolint: add bad opt access internal lint
David Wood [Mon, 25 Jul 2022 12:02:39 +0000 (13:02 +0100)]
lint: add bad opt access internal lint

Some command-line options accessible through `sess.opts` are best
accessed through wrapper functions on `Session`, `TyCtxt` or otherwise,
rather than through field access on the option struct in the `Session`.

Adds a new lint which triggers on those options that should be accessed
through a wrapper function so that this is prohibited. Options are
annotated with a new attribute `rustc_lint_opt_deny_field_access` which
can specify the error message (i.e. "use this other function instead")
to be emitted.

A simpler alternative would be to simply rename the options in the
option type so that it is clear they should not be used, however this
doesn't prevent uses, just discourages them. Another alternative would
be to make the option fields private, and adding accessor functions on
the option types, however the wrapper functions sometimes rely on
additional state from `Session` or `TyCtxt` which wouldn't be available
in an function on the option type, so the accessor would simply make the
field available and its use would be discouraged too.

Signed-off-by: David Wood <david.wood@huawei.com>
23 months agoAuto merge of #9249 - JohnTitor:book-prefer-checkout-v3, r=flip1995
bors [Wed, 27 Jul 2022 08:20:55 +0000 (08:20 +0000)]
Auto merge of #9249 - JohnTitor:book-prefer-checkout-v3, r=flip1995

Use `action/checkout@v3` in the book

As this type of document is often copied/pasted, using a newer version of `actions/checkout` would be better.

changelog: none

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
23 months agoUse `action/checkout@v3` in the book
Yuki Okushi [Wed, 27 Jul 2022 07:49:34 +0000 (16:49 +0900)]
Use `action/checkout@v3` in the book

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
23 months agoImplicitly set `--type=cargo` when using `--category=cargo`
Serial [Tue, 26 Jul 2022 23:32:34 +0000 (19:32 -0400)]
Implicitly set `--type=cargo` when using `--category=cargo`

23 months agoGive the user more information during creation
Serial [Tue, 26 Jul 2022 23:18:10 +0000 (19:18 -0400)]
Give the user more information during creation

23 months agoClippy fallout.
Camille GILLOT [Mon, 13 Jun 2022 09:53:31 +0000 (11:53 +0200)]
Clippy fallout.

23 months agoReplace LifetimeRes::Anonymous by LifetimeRes::Infer.
Camille GILLOT [Mon, 13 Jun 2022 06:22:06 +0000 (08:22 +0200)]
Replace LifetimeRes::Anonymous by LifetimeRes::Infer.

23 months agoAdd `--type` flag to `dev new_lint`
Serial [Thu, 14 Jul 2022 19:58:38 +0000 (15:58 -0400)]
Add `--type` flag to `dev new_lint`

23 months agoAuto merge of #9241 - Jarcho:ice_9238, r=xFrednet
bors [Mon, 25 Jul 2022 22:14:55 +0000 (22:14 +0000)]
Auto merge of #9241 - Jarcho:ice_9238, r=xFrednet

Fix ICE in `miri_to_const`

fixes #9238
changelog: Fix ICE when using `#![feature(generic_const_exprs)]` in various lints

23 months agoAuto merge of #9130 - c410-f3r:arith, r=llogiq
bors [Mon, 25 Jul 2022 21:26:15 +0000 (21:26 +0000)]
Auto merge of #9130 - c410-f3r:arith, r=llogiq

Add `Arithmetic` lint

Fixes https://github.com/rust-lang/rust-clippy/issues/8903

r? `@llogiq`

changelog: Add `Arithmetic` lint

23 months agoAuto merge of #97313 - cjgillot:ast-lifetimes-anon, r=petrochenkov
bors [Mon, 25 Jul 2022 20:02:55 +0000 (20:02 +0000)]
Auto merge of #97313 - cjgillot:ast-lifetimes-anon, r=petrochenkov

Resolve function lifetime elision on the AST

~Based on https://github.com/rust-lang/rust/pull/97720~

Lifetime elision for functions is purely syntactic in nature, so can be resolved on the AST.
This PR replicates the elision logic and diagnostics on the AST, and replaces HIR-based resolution by a `delay_span_bug`.

This refactor allows for more consistent diagnostics, which don't have to guess the original code from HIR.

r? `@petrochenkov`

23 months agoClippy fallout.
Camille GILLOT [Mon, 6 Jun 2022 18:26:41 +0000 (20:26 +0200)]
Clippy fallout.

23 months agoAuto merge of #9243 - Jarcho:std_core, r=Manishearth
bors [Mon, 25 Jul 2022 15:19:41 +0000 (15:19 +0000)]
Auto merge of #9243 - Jarcho:std_core, r=Manishearth

Don't lint `std_instead_of_core` on `std::env`

fixes #9239

This also reorders the execution of the lint to do as little as possible in the case where the path doesn't start with `std` or `alloc`.

changelog: [`std_instead_of_core`](https://rust-lang.github.io/rust-clippy/master/#std_instead_of_core): Don't lint on `use std::env`
changelog: [`std_instead_of_alloc`](https://rust-lang.github.io/rust-clippy/master/#std_instead_of_alloc): Don't lint `use std::vec` twice

23 months agoAuto merge of #9225 - tabokie:assert_ok, r=Jarcho
bors [Mon, 25 Jul 2022 15:00:27 +0000 (15:00 +0000)]
Auto merge of #9225 - tabokie:assert_ok, r=Jarcho

add `[assertions_on_result_states]` lint

Close #9162

changelog: add `[assertions_on_result_states]` lint

Signed-off-by: tabokie <xy.tao@outlook.com>
23 months agoAdd `[assertions_on_result_states]` lint
tabokie [Fri, 22 Jul 2022 05:17:10 +0000 (13:17 +0800)]
Add `[assertions_on_result_states]` lint

Signed-off-by: tabokie <xy.tao@outlook.com>
23 months agoAuto merge of #9246 - kyoto7250:reopen_issue_8493, r=Jarcho
bors [Mon, 25 Jul 2022 14:26:27 +0000 (14:26 +0000)]
Auto merge of #9246 - kyoto7250:reopen_issue_8493, r=Jarcho

check macro statements in `[non_copy_const]`

close #8493
close #9224

This PR fixes false positives in `[non_copy_const]`.

changelog: fix false positives in`[non_copy_const]`

---

r? `@Jarcho`

23 months agofixed tests to not use tokio
kyoto7250 [Mon, 25 Jul 2022 14:04:18 +0000 (23:04 +0900)]
fixed tests to not use tokio

23 months agocheck macro statements in non_copy_const.rs
kyoto7250 [Mon, 25 Jul 2022 12:41:12 +0000 (21:41 +0900)]
check macro statements in non_copy_const.rs

2 years agoAuto merge of #9245 - alex-semenyuk:enable_multiple_config_files_on_windows, r=Alexendoo
bors [Mon, 25 Jul 2022 12:24:41 +0000 (12:24 +0000)]
Auto merge of #9245 - alex-semenyuk:enable_multiple_config_files_on_windows, r=Alexendoo

Enable test multiple_config_files on windows

Verified that it actully works on windows
changelog: none

2 years agoEnable test multiple_config_files on windows
alex-semenyuk [Mon, 25 Jul 2022 10:57:26 +0000 (13:57 +0300)]
Enable test multiple_config_files on windows

2 years agoAuto merge of #9244 - Jarcho:ice-9242, r=flip1995
bors [Mon, 25 Jul 2022 08:12:15 +0000 (08:12 +0000)]
Auto merge of #9244 - Jarcho:ice-9242, r=flip1995

Fix ICE in `question_mark`

fixes #9242
changelog: [`question_mark`](https://rust-lang.github.io/rust-clippy/master/#question_mark): Fix ICE on zero field tuple structs

2 years agoImprove `[std|alloc]_instead_of_[alloc|core]` lints
Jason Newcomb [Mon, 25 Jul 2022 00:17:55 +0000 (20:17 -0400)]
Improve `[std|alloc]_instead_of_[alloc|core]` lints
* Don't call `TyCtxt::crate_name` unless necessary
* Don't lint on `use std::env`
* Only lint once on `use std::vec`

2 years agoFix ICE in `question_mark`
Jason Newcomb [Mon, 25 Jul 2022 03:12:29 +0000 (23:12 -0400)]
Fix ICE in `question_mark`

2 years agoFix ICE in `miri_to_const`
Jason Newcomb [Sun, 24 Jul 2022 22:23:33 +0000 (18:23 -0400)]
Fix ICE in `miri_to_const`

2 years agoAuto merge of #9237 - Alexendoo:useless-format-spans, r=Jarcho
bors [Sun, 24 Jul 2022 17:21:15 +0000 (17:21 +0000)]
Auto merge of #9237 - Alexendoo:useless-format-spans, r=Jarcho

Fix `useless_format` spans for `format!("{foo}")`

Fixes #9234

changelog: [`useless_format`]: Fix spans for `format!("{foo}")`

https://github.com/rust-lang/rust/pull/94030 made our workaround unneeded, but by coincidence our test still passed [because `Span::new()` swaps `hi` & `lo` if needed](https://github.com/rust-lang/rust/blob/c32dcbba187d1ee0dbe92dc152cb9c2f3f42900c/compiler/rustc_span/src/span_encoding.rs#L86-L88). So with a single character variable like `format!("{x}")` it still worked

2 years agoFix `useless_format` spans for `format!("{foo}")`
Alex Macleod [Sun, 24 Jul 2022 16:37:08 +0000 (16:37 +0000)]
Fix `useless_format` spans for `format!("{foo}")`

2 years agoAuto merge of #9235 - alex-semenyuk:fixing_guide_link, r=llogiq
bors [Sun, 24 Jul 2022 11:49:22 +0000 (11:49 +0000)]
Auto merge of #9235 - alex-semenyuk:fixing_guide_link, r=llogiq

Fix src link

changelog: none

2 years agoFix src link
alexey semenyuk [Sun, 24 Jul 2022 08:22:50 +0000 (11:22 +0300)]
Fix src link

2 years agoAuto merge of #9230 - RalfJung:fix-doc-lint-names, r=Alexendoo
bors [Sat, 23 Jul 2022 13:05:21 +0000 (13:05 +0000)]
Auto merge of #9230 - RalfJung:fix-doc-lint-names, r=Alexendoo

fix outdated lint names in docs

*Please write a short comment explaining your change (or "none" for internal only changes)*

changelog: fix outdated lint names in "as_conversions" documentation

2 years agofix outdated lint names in docs
Ralf Jung [Sat, 23 Jul 2022 12:36:26 +0000 (08:36 -0400)]
fix outdated lint names in docs

2 years agoAuto merge of #9229 - FoseFx:case_sensitive_file_extension_comparisons_doc, r=dswij
bors [Sat, 23 Jul 2022 11:59:19 +0000 (11:59 +0000)]
Auto merge of #9229 - FoseFx:case_sensitive_file_extension_comparisons_doc, r=dswij

Update case_sensitive_file_extension_comparisons example

Closing #9220

changelog: [`case_sensitive_file_extension_comparisons`]: update example

2 years agoDo not resolve associated const when there is no provided value
Michael Goulet [Fri, 15 Jul 2022 05:37:32 +0000 (05:37 +0000)]
Do not resolve associated const when there is no provided value

2 years agounwrap_used: Fix help, "an `None`" -> "`None`"
Sosthène Guédon [Fri, 22 Jul 2022 17:14:31 +0000 (19:14 +0200)]
unwrap_used: Fix help, "an `None`" -> "`None`"

2 years agoupdate case_sensitive_file_extension_comparisons example
Max Baumann [Fri, 22 Jul 2022 14:39:45 +0000 (16:39 +0200)]
update case_sensitive_file_extension_comparisons example
The old example does not work in case the delimiter is not in the name

Co-authored-by: flip1995 <9744647+flip1995@users.noreply.github.com>
2 years agounwrap_used: Stop recommending using `expect` when the `expect_used` lint is not...
Sosthène Guédon [Thu, 21 Jul 2022 20:45:12 +0000 (22:45 +0200)]
unwrap_used: Stop recommending using `expect` when the `expect_used` lint is not allowed

2 years agoAuto merge of #9214 - Jarcho:assign_op_prim, r=Manishearth
bors [Thu, 21 Jul 2022 17:00:40 +0000 (17:00 +0000)]
Auto merge of #9214 - Jarcho:assign_op_prim, r=Manishearth

Check `assign_op_pattern` for conflicting borrows

fixes #9180

changelog: [`assign_op_pattern`](https://rust-lang.github.io/rust-clippy/master/#assign_op_pattern): Don't lint when the suggestion would cause borrowck errors.

2 years agoAuto merge of #9215 - alex-semenyuk:enable_test_entrypoint_recursion, r=Jarcho
bors [Thu, 21 Jul 2022 15:45:50 +0000 (15:45 +0000)]
Auto merge of #9215 - alex-semenyuk:enable_test_entrypoint_recursion, r=Jarcho

Enable test for entrypoint_recursion for windows

Verified that this test actually works on windows
changelog: none

2 years agoAuto merge of #9216 - smoelius:master, r=flip1995
bors [Thu, 21 Jul 2022 07:58:27 +0000 (07:58 +0000)]
Auto merge of #9216 - smoelius:master, r=flip1995

Add `ui_cargo_toml_metadata` test

This PR adds a test to check the metadata of packages in the `ui_cargo` directory.

A recent change to Cargo causes it to warn when it finds multiple packages with the same name in a git dependency (the issue is described [here](https://github.com/rust-lang/cargo/issues/10752)).

Many (if  not all) Dylint libraries depend upon `clippy_utils`. As a result of the change, one now sees the following when building a Dylint library:
```
warning: skipping duplicate package `fail` found at `/home/smoelius/.cargo/git/checkouts/rust-clippy-4b72815e96774b3d/0cb0f76/tests/ui-cargo/module_style/pass_mod`
warning: skipping duplicate package `fail` found at `/home/smoelius/.cargo/git/checkouts/rust-clippy-4b72815e96774b3d/0cb0f76/tests/ui-cargo/module_style/fail_no_mod`
warning: skipping duplicate package `cargo_common_metadata` found at `/home/smoelius/.cargo/git/checkouts/rust-clippy-4b72815e96774b3d/0cb0f76/tests/ui-cargo/cargo_common_metadata/fail_publish_true`
warning: skipping duplicate package `fail-cargo` found at `/home/smoelius/.cargo/git/checkouts/rust-clippy-4b72815e96774b3d/0cb0f76/tests/ui-cargo/cargo_rust_version/pass_cargo`
warning: skipping duplicate package `fail-clippy` found at `/home/smoelius/.cargo/git/checkouts/rust-clippy-4b72815e96774b3d/0cb0f76/tests/ui-cargo/cargo_rust_version/fail_clippy`
warning: skipping duplicate package `fail-both-same` found at `/home/smoelius/.cargo/git/checkouts/rust-clippy-4b72815e96774b3d/0cb0f76/tests/ui-cargo/cargo_rust_version/fail_both_same`
warning: skipping duplicate package `fail-file-attr` found at `/home/smoelius/.cargo/git/checkouts/rust-clippy-4b72815e96774b3d/0cb0f76/tests/ui-cargo/cargo_rust_version/fail_file_attr`
```
There appear to be two contributing factors:
- Some packages in `ui_cargo` could have a `publish = false` added to them.
- Some packages in `ui_cargo` seem to be inconsistently named.

The new test checks that each package in the `ui_cargo` directory has a name matching one of its parent directories, and `publish = false` in its metadata (with a few exceptions).

Note that the packages in `cargo_common_metadata` require special care because `publish` is the subject of some of the `cargo_common_metadata` tests.

Also note that this PR adds `walkdir` as a dev dependency to the `clippy` package. However, it was already a dependency of `clippy_dev` and `lintcheck`. So hopefully this is acceptable.

Our continued thanks for making `clippy_utils` available, BTW. :)

r? `@flip1995`

changelog: none

2 years agoAuto merge of #9217 - Serial-ATA:extra-newlines, r=giraffate
bors [Thu, 21 Jul 2022 06:04:43 +0000 (06:04 +0000)]
Auto merge of #9217 - Serial-ATA:extra-newlines, r=giraffate

Remove extra newlines in [`significant_drop_in_scrutinee`] docs

changelog: none

2 years agoRemove extra newlines in [`significant_drop_in_scrutinee`] docs
Serial [Thu, 21 Jul 2022 01:35:11 +0000 (21:35 -0400)]
Remove extra newlines in [`significant_drop_in_scrutinee`] docs

2 years agoEnable test for entrypoint_recursion for windows
alex-semenyuk [Wed, 20 Jul 2022 18:41:12 +0000 (21:41 +0300)]
Enable test for entrypoint_recursion for windows

2 years agoDon't lint `assign_op_pattern` when the suggestion would cause borrowck errors
Jason Newcomb [Wed, 20 Jul 2022 14:00:04 +0000 (10:00 -0400)]
Don't lint `assign_op_pattern` when the suggestion would cause borrowck errors

2 years agoRevert "Rollup merge of #98582 - oli-obk:unconstrained_opaque_type, r=estebank"
Oli Scherer [Wed, 20 Jul 2022 07:55:58 +0000 (07:55 +0000)]
Revert "Rollup merge of #98582 - oli-obk:unconstrained_opaque_type, r=estebank"

This reverts commit 6f8fb911ad504b77549cf3256a09465621beab9d, reversing
changes made to 7210e46dc69a4b197a313d093fe145722c248b7d.

2 years agoAuto merge of #9207 - Jarcho:todo_arm, r=giraffate
bors [Wed, 20 Jul 2022 01:38:00 +0000 (01:38 +0000)]
Auto merge of #9207 - Jarcho:todo_arm, r=giraffate

Check for `todo!` on every expression in `SpanlessEq`

fixes #9204
changelog: [`match_same_arms`](https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms): Don't lint on arms with `todo!`

2 years agoAuto merge of #9210 - evantypanski:issue9160, r=Manishearth
bors [Tue, 19 Jul 2022 21:16:34 +0000 (21:16 +0000)]
Auto merge of #9210 - evantypanski:issue9160, r=Manishearth

Fix suggestion causing error for [`needless_borrow`] function in field

Fixes #9160

changelog: [`needless_borrow`]: Fix suggestion removing parens from calling a field

2 years agoUse parens around [`needless_borrow`] field calls
Evan Typanski [Tue, 19 Jul 2022 19:17:24 +0000 (15:17 -0400)]
Use parens around [`needless_borrow`] field calls

2 years agoCheck for `todo!` on every expression in `SpanlessEq`
Jason Newcomb [Tue, 19 Jul 2022 13:53:00 +0000 (09:53 -0400)]
Check for `todo!` on every expression in `SpanlessEq`

2 years agoMention first and last macro in backtrace
Michael Goulet [Tue, 21 Jun 2022 02:25:52 +0000 (19:25 -0700)]
Mention first and last macro in backtrace

2 years agoAdd Arithmetic lint
Caio [Mon, 18 Jul 2022 17:29:45 +0000 (14:29 -0300)]
Add Arithmetic lint

2 years agoAuto merge of #9202 - PaulTheNeko:patch-1, r=Manishearth
bors [Mon, 18 Jul 2022 16:10:06 +0000 (16:10 +0000)]
Auto merge of #9202 - PaulTheNeko:patch-1, r=Manishearth

Fix typo in alloc_instead_of_core

The description previously claimed it ensures items are imported from alloc, to ensure a crate won't require alloc, which can't be true.

I'm not sure know how to better phrase the changelog entry below.

changelog: [`alloc_instead_of_core`]: fixed typo in description

2 years agoFix typo in alloc_instead_of_core
Paul [Mon, 18 Jul 2022 14:24:30 +0000 (16:24 +0200)]
Fix typo in alloc_instead_of_core

The description previously claimed it ensures items are imported from alloc, to ensure a crate won't require alloc, which can't be true.

2 years agoAuto merge of #9148 - arieluy:then_some_unwrap_or, r=Jarcho
bors [Mon, 18 Jul 2022 12:45:11 +0000 (12:45 +0000)]
Auto merge of #9148 - arieluy:then_some_unwrap_or, r=Jarcho

Add new lint `obfuscated_if_else`

part of #9100, additional commits could make it work with `then` and `unwrap_or_else` as well

changelog: Add new lint `obfuscated_if_else`

2 years agoAuto merge of #9199 - Xiretza:unused-self-exported-api, r=Jarcho
bors [Mon, 18 Jul 2022 12:29:22 +0000 (12:29 +0000)]
Auto merge of #9199 - Xiretza:unused-self-exported-api, r=Jarcho

unused_self: respect avoid-breaking-exported-api

```
changelog: [`unused_self`]: Now respects the `avoid-breaking-exported-api` config option
```

Fixes #9195.

I mostly copied the implementation from `unnecessary_wraps`, since I don't have much understanding of rustc internals.

2 years agoAuto merge of #9146 - arieluy:type_params, r=dswij
bors [Mon, 18 Jul 2022 10:13:39 +0000 (10:13 +0000)]
Auto merge of #9146 - arieluy:type_params, r=dswij

Fix `mismatching_type_param_order` false positive

changelog: Don't lint `mismatching_type_param_order` on complicated generic params

fixes #8962

2 years agounused_self: respect avoid-breaking-exported-api
Xiretza [Mon, 18 Jul 2022 08:36:48 +0000 (10:36 +0200)]
unused_self: respect avoid-breaking-exported-api

2 years agoAuto merge of #9176 - JoelMon:patch-1, r=flip1995
bors [Mon, 18 Jul 2022 07:46:30 +0000 (07:46 +0000)]
Auto merge of #9176 - JoelMon:patch-1, r=flip1995

Rephrased text to remove passive voice for a more active one.

changelog: none

2 years agoRephrased text to remove passive voice for a more active one.
Joel Montes de Oca [Thu, 14 Jul 2022 14:20:08 +0000 (10:20 -0400)]
Rephrased text to remove passive voice for a more active one.

Co-authored-by: Alex <69764315+Serial-ATA@users.noreply.github.com>
2 years agoMerge commit 'fdb84cbfd25908df5683f8f62388f663d9260e39' into clippyup
Philipp Krones [Mon, 18 Jul 2022 07:39:37 +0000 (09:39 +0200)]
Merge commit 'fdb84cbfd25908df5683f8f62388f663d9260e39' into clippyup

2 years agoAdd `ui_cargo_toml_metadata` test
Samuel E. Moelius III [Sun, 17 Jul 2022 22:10:01 +0000 (18:10 -0400)]
Add `ui_cargo_toml_metadata` test

2 years agoAdd new lint `obfuscated_if_else`
Ariel Uy [Sun, 10 Jul 2022 21:37:38 +0000 (14:37 -0700)]
Add new lint `obfuscated_if_else`

New lint suggests using `if .. else ..` instead of
`.then_some(..).unwrap_or(..)`.

2 years agoAuto merge of #9196 - alex-semenyuk:invalid_regex, r=Jarcho
bors [Sun, 17 Jul 2022 23:08:04 +0000 (23:08 +0000)]
Auto merge of #9196 - alex-semenyuk:invalid_regex, r=Jarcho

Fix example for `clippy::invalid_regex`

Close #9194
changelog: previous example doesn't trigger lint

2 years agoFix example for `clippy::invalid_regex`
alexey semenyuk [Sun, 17 Jul 2022 21:35:34 +0000 (00:35 +0300)]
Fix example for `clippy::invalid_regex`

2 years agoFix `mismatching_type_param_order` false positive
Ariel Uy [Sun, 10 Jul 2022 16:39:36 +0000 (09:39 -0700)]
Fix `mismatching_type_param_order` false positive

Previously was giving false positive when an impl had a nontrivial
generic argument such as a tuple. Don't lint on these cases.

2 years agoAuto merge of #9022 - alex-semenyuk:needless_option_take_more_docs, r=Jarcho
bors [Sun, 17 Jul 2022 13:33:40 +0000 (13:33 +0000)]
Auto merge of #9022 - alex-semenyuk:needless_option_take_more_docs, r=Jarcho

`NEEDLESS_OPTION_TAKE` doc improvements

changelog: More info on `NEEDLESS_OPTION_TAKE`

2 years agoNEEDLESS_OPTION_TAKE doc improvements
alexey semenyuk [Sun, 19 Jun 2022 14:15:14 +0000 (14:15 +0000)]
NEEDLESS_OPTION_TAKE doc improvements

NEEDLESS_OPTION_TAKE doc improvements

NEEDLESS_OPTION_TAKE doc improvements

NEEDLESS_OPTION_TAKE doc improvements

NEEDLESS_OPTION_TAKE doc improvements

NEEDLESS_OPTION_TAKE doc improvements

NEEDLESS_OPTION_TAKE doc improvements

NEEDLESS_OPTION_TAKE doc improvements

2 years agoStabilize `let_chains`
Caio [Tue, 12 Jul 2022 18:36:59 +0000 (15:36 -0300)]
Stabilize `let_chains`

2 years agoRollup merge of #99342 - TaKO8Ki:avoid-symbol-to-string-conversions, r=compiler-errors
Matthias Krüger [Sat, 16 Jul 2022 20:30:56 +0000 (22:30 +0200)]
Rollup merge of #99342 - TaKO8Ki:avoid-symbol-to-string-conversions, r=compiler-errors

Avoid some `Symbol` to `String` conversions

This patch removes some Symbol to String conversions.

2 years agoAuto merge of #9171 - Serial-ATA:highlight-js, r=xFrednet
bors [Sat, 16 Jul 2022 20:02:44 +0000 (20:02 +0000)]
Auto merge of #9171 - Serial-ATA:highlight-js, r=xFrednet

Update highlight.js

changelog: none

With [highlight.js v11.6.0](https://github.com/highlightjs/highlight.js/releases/tag/11.6.0), the lint list can finally update from `9.5.0`. No more EOL warning in console! :smile:

I also made it switch to the `github-dark` theme when using `coal`, instead of just always using the normal github light theme.

r? `@xFrednet`

2 years agoavoid some `Symbol` to `String` conversions
Takayuki Maeda [Sat, 16 Jul 2022 19:09:20 +0000 (04:09 +0900)]
avoid some `Symbol` to `String` conversions

2 years agoAuto merge of #9172 - Guilherme-Vasconcelos:master, r=flip1995
bors [Fri, 15 Jul 2022 16:04:30 +0000 (16:04 +0000)]
Auto merge of #9172 - Guilherme-Vasconcelos:master, r=flip1995

Rename rustcSource in contributing documentation

According to [rust-analyzer docs](https://rust-analyzer.github.io/manual.html#toolchain:~:text=rust%2Danalyzer.rustc.source), rustcSource has been renamed to rustc.source.

changelog: none

2 years agoIntroduce opaque type to hidden type projection
Oli Scherer [Wed, 22 Jun 2022 15:28:28 +0000 (15:28 +0000)]
Introduce opaque type to hidden type projection

2 years agoRename rustcSource in contributing docs
Guilherme-Vasconcelos [Wed, 13 Jul 2022 00:06:10 +0000 (21:06 -0300)]
Rename rustcSource in contributing docs

2 years agoAuto merge of #9178 - alex-semenyuk:match_like_matches_macro_fix, r=Jarcho
bors [Fri, 15 Jul 2022 13:57:46 +0000 (13:57 +0000)]
Auto merge of #9178 - alex-semenyuk:match_like_matches_macro_fix, r=Jarcho

match_like_matches_macro does not trigger when one arm contains conta…

Close #9163
changelog: none

2 years agoAuto merge of #9174 - flip1995:rustup, r=Jarcho
bors [Fri, 15 Jul 2022 13:38:01 +0000 (13:38 +0000)]
Auto merge of #9174 - flip1995:rustup, r=Jarcho

Rustup

r? `@ghost`

changelog: none

2 years agoAuto merge of #9103 - i509VCB:std-instead-of-core, r=Manishearth
bors [Fri, 15 Jul 2022 11:46:24 +0000 (11:46 +0000)]
Auto merge of #9103 - i509VCB:std-instead-of-core, r=Manishearth

Add `std_instead_of_core`, `std_instead_of_alloc`, `alloc_instead_of_core`

Closes #7724

Introduces 3 new lints:
- `std_instead_of_core` - lints items resolved through `std` which are available in `core`
- `std_instead_of_alloc` - lints items resolved through `std` which are available in `alloc`
- `alloc_instead_of_core` - lints items resolved through `alloc` which are available in `core`

Though the original issue only mentions `std_instead_of_alloc`, the other two lints could be useful as well.

questions:
- what do I call the file the lints live in? I was thinking `std_reexports`?

changelog: new lint's: [`std_instead_of_core`], [`std_instead_of_alloc`], [`alloc_instead_of_core`]

2 years agoBump nightly version -> 2022-07-15
Philipp Krones [Fri, 15 Jul 2022 07:49:38 +0000 (09:49 +0200)]
Bump nightly version -> 2022-07-15

2 years agoMerge remote-tracking branch 'upstream/master' into rustup
Philipp Krones [Fri, 15 Jul 2022 07:49:15 +0000 (09:49 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup

2 years agomatch_like_matches_macro does not trigger when one arm contains contains a block...
alex-semenyuk [Fri, 15 Jul 2022 06:15:31 +0000 (09:15 +0300)]
match_like_matches_macro does not trigger when one arm contains contains a block with only a bool literal

2 years agostd_instead_of_core, std_instead_of_alloc, alloc_instead_of_core
i509VCB [Sat, 2 Jul 2022 04:59:03 +0000 (23:59 -0500)]
std_instead_of_core, std_instead_of_alloc, alloc_instead_of_core