]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoAuto merge of #7386 - camsteffen:fmt-workaround, r=flip1995
bors [Mon, 21 Jun 2021 17:01:51 +0000 (17:01 +0000)]
Auto merge of #7386 - camsteffen:fmt-workaround, r=flip1995

Remove rustfmt bug workaround

The bug is reportedly fixed.

changelog: none

3 years agoRemove rustfmt workaround
Cameron Steffen [Mon, 21 Jun 2021 15:50:36 +0000 (10:50 -0500)]
Remove rustfmt workaround

3 years agoAuto merge of #7385 - xFrednet:0000-fix-broken-deploy, r=flip1995
bors [Mon, 21 Jun 2021 08:55:38 +0000 (08:55 +0000)]
Auto merge of #7385 - xFrednet:0000-fix-broken-deploy, r=flip1995

Fixed broken deploy script due to multiline configuration docs

The deploy script on master currently runs into an error (See [log](https://github.com/rust-lang/rust-clippy/runs/2865828873)) due to the new configuration documentation added in #7299. The current documentation collection for the configuration macro sadly doesn't support multiline doc comments. This will be changes in the future with the new metadata collector tracked in #7172 For now we have to use `<br>` inside doc comments to add paragraphs.

This PR restricts `define_Conf!` macro to single lines and adds a comment explaining the reasoning behind it. It also adjusted the actual document parsing to fix a bug. (The parsing was automatically stopping on the first curly bracket, even if it was part of a doc comment).

changelog: none

3 years agoAuto merge of #7382 - matthiaskrgr:config_name, r=flip1995
bors [Mon, 21 Jun 2021 08:41:25 +0000 (08:41 +0000)]
Auto merge of #7382 - matthiaskrgr:config_name, r=flip1995

Fix wrong config option being suggested for deprecated wrong_pub_self_convention lint

Problem:
for code like
````rust
#![warn(clippy::wrong_pub_self_convention)]
fn main() {
    println!("Hello, world!");
}
````
clippy will issue a warning to use a clippy.toml option instead:

````
warning: lint `clippy::wrong_pub_self_convention` has been removed: set the `avoid_breaking_exported_api` config option to `false` to enable the `wrong_self_convention` lint for public items
 --> src/main.rs:2:9
  |
2 | #![warn(clippy::wrong_pub_self_convention)]
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(renamed_and_removed_lints)]` on by default
````

But using the lint name as seen in the warning message
`echo "avoid_breaking_exported_api = true\n" > clippy.toml`

Will cause an error:
````
error: error reading Clippy's configuration file `/tmp/clippytest/clippy.toml`: unknown field `avoid_breaking_exported_api`, expected one of `avoid-breaking-exported-api`, ...
````

Replace the underscores with dashes in the deprecation message.

changelog: avoid_breaking_exported_api: suggest correct clippy config toml option in the deprecation message

3 years agoAuto merge of #7380 - popzxc:compile-test-helper, r=flip1995
bors [Mon, 21 Jun 2021 08:27:14 +0000 (08:27 +0000)]
Auto merge of #7380 - popzxc:compile-test-helper, r=flip1995

Improve panic message on "Found multiple rlibs" error in compile-test

Related to #7343

When I first met this error I was pretty much confused, so I thought it may be a good idea to:

- Give a hint on what to do to users that don't want to dig into specifics and just want to quickly resolve the issue.
- Give a link for those who are interested in details.

## Old appearance:

<img width="1121" alt="Screenshot 2021-06-20 at 08 30 34" src="https://user-images.githubusercontent.com/12111581/122663361-df8ae780-d1aa-11eb-9236-775b4fd754d5.png">

## New appearance:

<img width="1121" alt="Screenshot 2021-06-20 at 08 32 18" src="https://user-images.githubusercontent.com/12111581/122663363-e4e83200-d1aa-11eb-9c46-f62d83eb79e2.png">

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

changelog: none

3 years agoProvide different message for bootstrapped compiler
Igor Aleksanov [Mon, 21 Jun 2021 03:57:57 +0000 (06:57 +0300)]
Provide different message for bootstrapped compiler

3 years agoFixed broken deploy script due to multiline configuration docs
xFrednet [Sun, 20 Jun 2021 20:32:32 +0000 (22:32 +0200)]
Fixed broken deploy script due to multiline configuration docs

3 years agoFix wrong config option being suggested for deprecated wrong_pub_self_convention...
Matthias Krüger [Sun, 20 Jun 2021 11:48:44 +0000 (13:48 +0200)]
Fix wrong config option being suggested for deprecated wrong_pub_self_convention lint

Problem:
for code like
````
fn main() {
    println!("Hello, world!");
}
````
clippy will issue a warning to use a clippy.toml option instead:

````
warning: lint `clippy::wrong_pub_self_convention` has been removed: set the `avoid_breaking_exported_api` config option to `false` to enable the `wrong_self_convention` lint for public items
 --> src/main.rs:2:9
  |
2 | #![warn(clippy::wrong_pub_self_convention)]
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(renamed_and_removed_lints)]` on by default
````

But using the lint name as seen in the warning message
echo "avoid_breaking_exported_api = true\n" > clippy.toml

Will cause an error:
````
error: error reading Clippy's configuration file `/tmp/clippytest/clippy.toml`: unknown field `avoid_breaking_exported_api`, expected one of `avoid-breaking-exported-api`, ...
````

Replace the underscores with dashes in the deprecation message.

changelog: avoid_breaking_exported_api: suggest correct clippy config toml option in the deprecation message

3 years agoImprove appearance
Igor Aleksanov [Sun, 20 Jun 2021 05:32:43 +0000 (08:32 +0300)]
Improve appearance

3 years agoImprove visibility&helpfulness of the 'found multiple rlibs' error
Igor Aleksanov [Sun, 20 Jun 2021 05:25:30 +0000 (08:25 +0300)]
Improve visibility&helpfulness of the 'found multiple rlibs' error

3 years agoAuto merge of #7299 - DevinR528:macro-brace, r=llogiq
bors [Sat, 19 Jun 2021 17:56:56 +0000 (17:56 +0000)]
Auto merge of #7299 - DevinR528:macro-brace, r=llogiq

Add macro_braces lint to check for irregular brace use in certain macros

The name is a bit long but this sounds good as `#[allow(unconventional_macro_braces)]` and it seems more clear that we are talking about the macro call not macro definitions, any feedback let me know. Thanks!
fixes #7278

changelog: Add ``[`unconventional_macro_braces`]`` lint that checks for uncommon brace usage with macros.

3 years agoAuto merge of #7375 - djc:from-iter-pedantic, r=Manishearth
bors [Sat, 19 Jun 2021 08:01:58 +0000 (08:01 +0000)]
Auto merge of #7375 - djc:from-iter-pedantic, r=Manishearth

Move from-iter-instead-of-collect to pedantic

Since FromIterator will become part of the prelude, this lint being
warn by default is incongruous with the libs team position on the topic.

Fixes #7213.

---

changelog: moved [`from_iter_instead_of_collect`] to `pedantic` group

3 years agoMove from-iter-instead-of-collect to pedantic
Dirkjan Ochtman [Fri, 18 Jun 2021 20:18:16 +0000 (22:18 +0200)]
Move from-iter-instead-of-collect to pedantic

Since FromIterator will become part of the prelude, this lint being
warn by default is incongruous with the libs team position on the topic.

3 years agoAuto merge of #7371 - flip1995:changelog, r=flip1995
bors [Thu, 17 Jun 2021 19:09:12 +0000 (19:09 +0000)]
Auto merge of #7371 - flip1995:changelog, r=flip1995

Fix link in changelog

r? `@ghost`

changelog: none

3 years agoFix link in changelog
flip1995 [Thu, 17 Jun 2021 19:05:30 +0000 (21:05 +0200)]
Fix link in changelog

3 years agoAuto merge of #7366 - flip1995:changelog, r=Manishearth
bors [Thu, 17 Jun 2021 17:38:25 +0000 (17:38 +0000)]
Auto merge of #7366 - flip1995:changelog, r=Manishearth

Update changelog

[Rendered](https://github.com/flip1995/rust-clippy/blob/changelog/CHANGELOG.md)

Way fewer new lints than usual. Also now "Documentation" or "Others" updates this time.

changelog: none

3 years agoAuto merge of #7367 - flip1995:backport_remerge, r=flip1995
bors [Thu, 17 Jun 2021 16:07:48 +0000 (16:07 +0000)]
Auto merge of #7367 - flip1995:backport_remerge, r=flip1995

Remerge Beta backport changes

We do this to keep the Clippy commits that are in rust-lang/rust also in Clippy.

r? `@ghost`

changelog: none

3 years agoMerge remote-tracking branch 'upstream/beta' into backport_remerge
flip1995 [Thu, 17 Jun 2021 16:04:58 +0000 (18:04 +0200)]
Merge remote-tracking branch 'upstream/beta' into backport_remerge

3 years agoUpdate changelog
flip1995 [Thu, 17 Jun 2021 15:59:08 +0000 (17:59 +0200)]
Update changelog

3 years agoAdd macro_braces lint to check for irregular brace use in certain macros
Devin Ragotzy [Sun, 30 May 2021 21:58:32 +0000 (17:58 -0400)]
Add macro_braces lint to check for irregular brace use in certain macros

Rename unconventional -> nonstandard, add config field

Add standard_macro_braces fields so users can specify macro names and
brace combinations to lint for in the clippy.toml file.

Fix errors caused by nonstandard_macro_braces in other lint tests

Fix users ability to override the default nonstandard macro braces

Add type position macros impl `check_ty`

3 years agoAuto merge of #7364 - flip1995:rustup, r=flip1995
bors [Thu, 17 Jun 2021 08:25:26 +0000 (08:25 +0000)]
Auto merge of #7364 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

changelog: none

3 years agoBump Clippy version -> 0.1.55
flip1995 [Thu, 17 Jun 2021 08:23:08 +0000 (10:23 +0200)]
Bump Clippy version -> 0.1.55

3 years agoBump nightly version -> 2021-06-17
flip1995 [Thu, 17 Jun 2021 08:22:31 +0000 (10:22 +0200)]
Bump nightly version -> 2021-06-17

3 years agoMerge remote-tracking branch 'upstream/master' into rustup
flip1995 [Thu, 17 Jun 2021 08:21:47 +0000 (10:21 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup

3 years agoAuto merge of #7352 - camsteffen:metadata-syntax, r=xFrednet
bors [Tue, 15 Jun 2021 21:44:00 +0000 (21:44 +0000)]
Auto merge of #7352 - camsteffen:metadata-syntax, r=xFrednet

Fix metadata code block syntax highlighting

changelog: none

Fixes code fence block in the metadata collector to change ` ``` ` or ` ```ignore` or ` ```rust,ignore` to ` ```rust`. This makes syntax highlighting work more consistently on the website.

3 years agoImprove metadata code block parsing
Cameron Steffen [Mon, 14 Jun 2021 19:10:19 +0000 (14:10 -0500)]
Improve metadata code block parsing

3 years agoAuto merge of #7355 - Pyther99:common-tools-link, r=camsteffen
bors [Tue, 15 Jun 2021 15:44:40 +0000 (15:44 +0000)]
Auto merge of #7355 - Pyther99:common-tools-link, r=camsteffen

Fix link in docs

The [docs](https://github.com/rust-lang/rust-clippy/blob/master/doc/common_tools_writing_lints.md) had an incorrect link for "Checking if a type defines a specific method".

changelog: none

3 years agoFix link
Pyther99 [Tue, 15 Jun 2021 15:38:16 +0000 (17:38 +0200)]
Fix link

3 years agoAuto merge of #7345 - DevinR528:disallowed-fix, r=Manishearth
bors [Mon, 14 Jun 2021 14:57:56 +0000 (14:57 +0000)]
Auto merge of #7345 - DevinR528:disallowed-fix, r=Manishearth

Remove requirement of fully qualified path for disallowed_method/type

changelog: Remove the need for fully qualified paths in disallowed_method and disallowed_type

After fixing this issue in [import_rename](https://github.com/rust-lang/rust-clippy/pull/7300#discussion_r650127720) I figured I'd fix it for these two.

If this does in fact fix the **Known problems:** section I was planning to remove them from both lints after confirmation.

3 years agoAuto merge of #7270 - Valentine-Mario:vec_extend_to_append, r=flip1995
bors [Mon, 14 Jun 2021 06:58:12 +0000 (06:58 +0000)]
Auto merge of #7270 - Valentine-Mario:vec_extend_to_append, r=flip1995

Vec extend to append

This PR adds a check to suggest changes of vector from

```
vec.extend(other_vec.drain(..))
```

could be written as

```
vec![].append(&mut vec![]);
```

changelog: Add vec_extend_to_append lint
issue: #7209

3 years agoAuto merge of #7288 - camsteffen:use-self2, r=phansch
bors [Mon, 14 Jun 2021 05:49:29 +0000 (05:49 +0000)]
Auto merge of #7288 - camsteffen:use-self2, r=phansch

Fix use_self FPs on type params

changelog: Fix [`use_self`] false positives on type parameters

Fixes #4140
Fixes #7139

3 years agofixup! Remove requirement of fully qualified path for disallowed_method/type
Devin Ragotzy [Sun, 13 Jun 2021 19:52:54 +0000 (15:52 -0400)]
fixup! Remove requirement of fully qualified path for disallowed_method/type

3 years agoRemove requirement of fully qualified path for disallowed_method/type
Devin Ragotzy [Fri, 11 Jun 2021 21:25:32 +0000 (17:25 -0400)]
Remove requirement of fully qualified path for disallowed_method/type

3 years agoAuto merge of #7160 - flip1995:field_reassign_macros, r=xFrednet,camsteffen
bors [Fri, 11 Jun 2021 15:58:58 +0000 (15:58 +0000)]
Auto merge of #7160 - flip1995:field_reassign_macros, r=xFrednet,camsteffen

Don't trigger `field_reassign_with_default` in macros

Fixes #7155

Producing a good suggestion for this lint is already hard when no macros
are involved. With macros the lint message and the suggestion are just
confusing. Since both, producing a good suggestion and figuring out if
this pattern can be re-written inside a macro is nearly impossible, just
bail out.

changelog: [`field_reassign_with_default`] No longer triggers in macros

---

No that our reviewing queue is under control, I want to start hacking on Clippy myself again. Starting with an easy issue to get back in :)

3 years agoAdd support for using qualified paths with structs in expression and pattern
Ryan Levick [Thu, 10 Dec 2020 12:20:07 +0000 (13:20 +0100)]
Add support for using qualified paths with structs in expression and pattern
position.

3 years agoadded lint to check for full range of vector and suggest append
valentine-mario [Thu, 10 Jun 2021 08:12:06 +0000 (09:12 +0100)]
added lint to check for full range of vector and suggest append

3 years agoAuto merge of #7333 - camsteffen:match-var, r=llogiq
bors [Thu, 10 Jun 2021 05:20:56 +0000 (05:20 +0000)]
Auto merge of #7333 - camsteffen:match-var, r=llogiq

Factor out match_var and get_pat_name utils

...because checking vars by name is bad, because of shadowing.

changelog: none

3 years agoAuto merge of #7332 - lengyijun:redundant_clone_fix, r=giraffate
bors [Thu, 10 Jun 2021 00:54:25 +0000 (00:54 +0000)]
Auto merge of #7332 - lengyijun:redundant_clone_fix, r=giraffate

redundant_clone: fix comment

changelog: none

3 years agoAuto merge of #7315 - DevinR528:disallowed-ty, r=giraffate
bors [Thu, 10 Jun 2021 00:30:36 +0000 (00:30 +0000)]
Auto merge of #7315 - DevinR528:disallowed-ty, r=giraffate

Add disallowed_type lint, this adds a field to the conf struct

Fixes #7277

changelog: Add ``[`disallowed_type`]`` a lint that can enforce banning types specified in the config.

3 years agoAuto merge of #86003 - pnkfelix:issue-84297-revert-81238, r=Mark-Simulacrum
bors [Wed, 9 Jun 2021 16:47:05 +0000 (16:47 +0000)]
Auto merge of #86003 - pnkfelix:issue-84297-revert-81238, r=Mark-Simulacrum

Make copy/copy_nonoverlapping fn's again

Make copy/copy_nonoverlapping fn's again, rather than intrinsics.

This a short-term change to address issue #84297.

It effectively reverts PRs #81167 #81238 (and part of #82967), #83091, and parts of #79684.

3 years agoAuto merge of #7334 - Thomasdezeeuw:freebsd-no-ticks, r=flip1995
bors [Wed, 9 Jun 2021 15:30:28 +0000 (15:30 +0000)]
Auto merge of #7334 - Thomasdezeeuw:freebsd-no-ticks, r=flip1995

Add FreeBSD as identifier not needing ticks

For the doc-markdown lint.

changelog: Add FreeBSD as identifier not needing ticks for ``[`doc-markdown`]`` lint.

3 years agoAdd FreeBSD as identifier not needing ticks
Thomas de Zeeuw [Wed, 9 Jun 2021 15:16:10 +0000 (17:16 +0200)]
Add FreeBSD as identifier not needing ticks

For the doc-markdown lint.

3 years agoFactor out match_var
Cameron Steffen [Wed, 9 Jun 2021 14:17:34 +0000 (09:17 -0500)]
Factor out match_var

3 years agoAdd disallowed_types lint, this adds a field to the Conf struct
Devin Ragotzy [Wed, 2 Jun 2021 11:20:45 +0000 (07:20 -0400)]
Add disallowed_types lint, this adds a field to the Conf struct

Replace use of node_type -> node_type_opt, fix clippy warnings

Don't walk the hir unnecessarily let the visitor do it

3 years agoAuto merge of #7326 - 1c3t3a:1c3t3a-issue-7324, r=flip1995
bors [Wed, 9 Jun 2021 08:39:56 +0000 (08:39 +0000)]
Auto merge of #7326 - 1c3t3a:1c3t3a-issue-7324, r=flip1995

Fix false positive on `semicolon_if_nothing_returned`

Currently the [`semicolon_if_nothing_returned`](https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned) lint fires in unwanted situations where a block only spans one line. An example of this was given in #7324. This code:

```rust
use std::mem::MaybeUninit;
use std::ptr;

fn main() {
    let mut s = MaybeUninit::<String>::uninit();
    let _d = || unsafe { ptr::drop_in_place(s.as_mut_ptr()) };
}
```

yields the following clippy error:
```
error: consider adding a `;` to the last statement for consistent formatting
 --> src/main.rs:6:26
  |
6 |     let _d = || unsafe { ptr::drop_in_place(s.as_mut_ptr()) };
  |                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `ptr::drop_in_place(s.as_mut_ptr());`
  |
  = note: `-D clippy::semicolon-if-nothing-returned` implied by `-D clippy::pedantic`
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
```

I updated the lint to check if the statement is inside an `unsafe` block, a closure or a normal block and if the block only spans one line, in that case the lint is not emitted.

This closes #7324.

changelog: enhanced semicolon if nothing returned according to  #7324.

3 years agoAuto merge of #7330 - xFrednet:0000-refactor-map-identity, r=flip1995
bors [Wed, 9 Jun 2021 08:27:05 +0000 (08:27 +0000)]
Auto merge of #7330 - xFrednet:0000-refactor-map-identity, r=flip1995

Refactoring identity function lints

I've noticed that we have several lints that all check for identity functions and each used their own check implementation. I moved the `is_expr_identity_function` function to `clippy_utils` and adapted all lints to reuse that one function. This should make the addition of new lints like this also easier in the future.

I've also moved the `map_identity` lint into the `methods` module. It's probably the best to review this PR by checking each commit individually. And that's it, have a great day :upside_down_face:

changelog: none

3 years agoRefactored multiline check
Bastian Kersting [Wed, 9 Jun 2021 07:39:11 +0000 (09:39 +0200)]
Refactored multiline check

3 years agoredundant_clone: fix comment
lyj [Wed, 9 Jun 2021 07:25:48 +0000 (15:25 +0800)]
redundant_clone: fix comment

3 years agoMove `map_identity` into the `methods` module
xFrednet [Mon, 7 Jun 2021 22:14:43 +0000 (00:14 +0200)]
Move `map_identity` into the `methods` module

3 years agoAuto merge of #7262 - Jarcho:while_let_on_iter_closure, r=xFrednet,flip1995
bors [Tue, 8 Jun 2021 15:52:40 +0000 (15:52 +0000)]
Auto merge of #7262 - Jarcho:while_let_on_iter_closure, r=xFrednet,flip1995

fix `while_let_on_iterator` suggestion in a closure

fixes: #7249

A future improvement would be to check if the closure is being used as `FnOnce`, in which case the original suggestion would be correct.

changelog: Suggest `&mut iter` inside a closure for `while_let_on_iterator`

3 years agoAuto merge of #7325 - Y-Nak:numeric-fallback, r=giraffate
bors [Tue, 8 Jun 2021 01:05:17 +0000 (01:05 +0000)]
Auto merge of #7325 - Y-Nak:numeric-fallback, r=giraffate

Fix FP in `default_numeric_fallback` with external macro expansion

fixes #7304

changelog: Fix `default_numeric_fallback` FP with external macro expansion

3 years agoReuse `is_expr_identity_function` for `filter_map_identity`
xFrednet [Mon, 7 Jun 2021 21:31:17 +0000 (23:31 +0200)]
Reuse `is_expr_identity_function` for `filter_map_identity`

3 years agoReuse `is_expr_identity_function` for `flat_map_identity`
xFrednet [Mon, 7 Jun 2021 21:10:42 +0000 (23:10 +0200)]
Reuse `is_expr_identity_function` for `flat_map_identity`

3 years agoExtracting `is_expr_identity_function` into `clippy_utils` for reusability
xFrednet [Mon, 7 Jun 2021 20:21:56 +0000 (22:21 +0200)]
Extracting `is_expr_identity_function` into `clippy_utils` for reusability

3 years agoRefactored the check for two spans on the same line
Bastian Kersting [Mon, 7 Jun 2021 19:44:04 +0000 (21:44 +0200)]
Refactored the check for two spans on the same line

3 years agoFix FP in `default_numeric_fallback` with external macro expansion
Yoshitomo Nakanishi [Sat, 5 Jun 2021 06:11:44 +0000 (15:11 +0900)]
Fix FP in `default_numeric_fallback` with external macro expansion

3 years agoFixed failing tests
Bastian Kersting [Sat, 5 Jun 2021 13:38:38 +0000 (15:38 +0200)]
Fixed failing tests

3 years agoEnhance semicolon_if_nothing_returned according to #7324
Bastian Kersting [Sat, 5 Jun 2021 12:27:36 +0000 (14:27 +0200)]
Enhance semicolon_if_nothing_returned according to #7324

3 years agoAuto merge of #7321 - flip1995:doc-release-stable-branch, r=xFrednet
bors [Sat, 5 Jun 2021 11:24:47 +0000 (11:24 +0000)]
Auto merge of #7321 - flip1995:doc-release-stable-branch, r=xFrednet

Release doc: add explanation for updating the stable branch

r? `@xFrednet`

[Rendered](https://github.com/flip1995/rust-clippy/blob/doc-release-stable-branch/doc/release.md)

changelog: none

3 years agoRevert clippy's path to the copy intrinsics (part of reverting PR 81238).
Felix S. Klock II [Fri, 4 Jun 2021 20:14:03 +0000 (16:14 -0400)]
Revert clippy's path to the copy intrinsics (part of reverting PR 81238).

3 years agoAuto merge of #7289 - camsteffen:needless-collect-shadow, r=Manishearth
bors [Fri, 4 Jun 2021 15:39:16 +0000 (15:39 +0000)]
Auto merge of #7289 - camsteffen:needless-collect-shadow, r=Manishearth

Fix needless_collect with binding shadowing

changelog: Fix [`needless_collect`] weird output when a binding is shadowed

Fixes #7200

3 years agoRelease doc: add explanation for updating the stable branch
flip1995 [Fri, 4 Jun 2021 14:57:03 +0000 (16:57 +0200)]
Release doc: add explanation for updating the stable branch

3 years agoRemove `doc(include)`
Joshua Nelson [Wed, 19 May 2021 01:46:41 +0000 (21:46 -0400)]
Remove `doc(include)`

3 years agoAuto merge of #7319 - m-ou-se:cfg-not-const, r=camsteffen
bors [Fri, 4 Jun 2021 11:49:23 +0000 (11:49 +0000)]
Auto merge of #7319 - m-ou-se:cfg-not-const, r=camsteffen

Don't warn about `cfg!(..)` as a constant in assertions

This makes clippy understand that `cfg!(..)` is not just a hardcoded `true` or `false` (even though it expands to one of those).

cc `@khyperia`

changelog: Don't treat `cfg!(..)` as a constant in [`assertions-on-constants`]

3 years agoAdd test for not linting on assert!(cfg!(..)).
Mara Bos [Fri, 4 Jun 2021 08:43:39 +0000 (10:43 +0200)]
Add test for not linting on assert!(cfg!(..)).

3 years agoDon't treat `cfg!()` as a constant.
Mara Bos [Fri, 4 Jun 2021 08:43:25 +0000 (10:43 +0200)]
Don't treat `cfg!()` as a constant.

3 years agoAuto merge of #7314 - flip1995:ci-win-rustup, r=flip1995
bors [Thu, 3 Jun 2021 07:12:51 +0000 (07:12 +0000)]
Auto merge of #7314 - flip1995:ci-win-rustup, r=flip1995

Revert "CI: update rustup before installing the toolchain on windows"

This reverts commit 716d03f86bc9d72e56c2d803fd76ff44f29c9b3a.

This is no longer necessary, since rustup 1.24.2 is now the default
version on the windows runner.

changelog: none

3 years agoRevert "CI: update rustup before installing the toolchain on windows"
flip1995 [Thu, 3 Jun 2021 06:55:15 +0000 (08:55 +0200)]
Revert "CI: update rustup before installing the toolchain on windows"

This reverts commit 716d03f86bc9d72e56c2d803fd76ff44f29c9b3a.

This is no longer necessary, since rustup 1.24.2 is now the default
version on the windows runner.

3 years agoMerge commit '3ae8faff4d46ad92f194c2a4b941c3152a701b31' into clippyup
flip1995 [Thu, 3 Jun 2021 06:41:37 +0000 (08:41 +0200)]
Merge commit '3ae8faff4d46ad92f194c2a4b941c3152a701b31' into clippyup

3 years agoAuto merge of #7313 - flip1995:rustup, r=flip1995
bors [Thu, 3 Jun 2021 06:40:25 +0000 (06:40 +0000)]
Auto merge of #7313 - flip1995:rustup, r=flip1995

Rustup

Empty rustup. No changes to Clippy in the Rust repo for the last 2 weeks :open_mouth:

changelog: none

3 years agoBump nightly version -> 2021-06-03
flip1995 [Thu, 3 Jun 2021 06:38:19 +0000 (08:38 +0200)]
Bump nightly version -> 2021-06-03

3 years agoMerge remote-tracking branch 'upstream/master' into rustup
flip1995 [Thu, 3 Jun 2021 06:37:53 +0000 (08:37 +0200)]
Merge remote-tracking branch 'upstream/master' into rustup

3 years agoAuto merge of #7297 - flip1995:rm-cov, r=giraffate
bors [Tue, 1 Jun 2021 01:22:43 +0000 (01:22 +0000)]
Auto merge of #7297 - flip1995:rm-cov, r=giraffate

Remove util/cov.sh script

This script hasn't been working and wasn't used for years.

changelog: none

3 years agoAuto merge of #7265 - Jarcho:manual_str_repeat, r=giraffate
bors [Tue, 1 Jun 2021 00:47:05 +0000 (00:47 +0000)]
Auto merge of #7265 - Jarcho:manual_str_repeat, r=giraffate

Add lint `manual_str_repeat`

fixes: #7260

There's a similar function for slices. Should this be renamed to include it, or should that be a separate lint? If we are going to have them as one lint a better name will be needed. `manual_repeat` isn't exactly clear as it's replacing a call to `iter::repeat`.

changelog: Add new lint `manual_str_repeat`

3 years agoRemove util/cov.sh script
flip1995 [Mon, 31 May 2021 15:09:21 +0000 (17:09 +0200)]
Remove util/cov.sh script

This script hasn't been working and wasn't used for years.

3 years agoFix type checks for `manual_str_repeat`
Jason Newcomb [Sun, 23 May 2021 17:16:09 +0000 (13:16 -0400)]
Fix type checks for `manual_str_repeat`

3 years agoAdd lint `manual_str_repeat`
Jason Newcomb [Sat, 22 May 2021 21:08:17 +0000 (17:08 -0400)]
Add lint `manual_str_repeat`

3 years agoAuto merge of #7294 - stevenengler:unsafe-ptr-deref-msg, r=Manishearth
bors [Mon, 31 May 2021 00:36:46 +0000 (00:36 +0000)]
Auto merge of #7294 - stevenengler:unsafe-ptr-deref-msg, r=Manishearth

Improve message for `not_unsafe_ptr_arg_deref` lint

changelog: Improved message for the ['not_unsafe_ptr_arg_deref'] lint

Doesn't close any issue, but implements a suggestion from https://github.com/rust-lang/rust-clippy/issues/3045#issuecomment-791556803.

3 years agoUpdate message for 'not_unsafe_ptr_arg_deref' lint
Steven Engler [Mon, 31 May 2021 00:19:57 +0000 (20:19 -0400)]
Update message for 'not_unsafe_ptr_arg_deref' lint

3 years agoAuto merge of #7292 - Jarcho:suspicious_splitn, r=flip1995
bors [Sun, 30 May 2021 20:32:22 +0000 (20:32 +0000)]
Auto merge of #7292 - Jarcho:suspicious_splitn, r=flip1995

Add lint `suspicious_splitn`

fixes: #7245
changelog: Add lint `suspicious_splitn`

3 years agoEvaluate constant expressions in `suspicious_splitn`
Jason Newcomb [Sun, 30 May 2021 17:25:24 +0000 (13:25 -0400)]
Evaluate constant expressions in `suspicious_splitn`

3 years agoAdd lint `suspicious_splitn`
Jason Newcomb [Sun, 30 May 2021 13:35:06 +0000 (09:35 -0400)]
Add lint `suspicious_splitn`

3 years agoAuto merge of #7287 - Jarcho:ice_7272, r=flip1995
bors [Fri, 28 May 2021 09:22:22 +0000 (09:22 +0000)]
Auto merge of #7287 - Jarcho:ice_7272, r=flip1995

Fix ICE in `too_many_lines`

fixes: #7272
fixes: #7286

#7272 looks like it's caused by a bug in rust-c. The span it's giving for the closure is:

```rust
$crate:: $lower($d arg) }
        }
    }
}
```

The correct span would be `$crate:: $lower($d arg)` without all the closing braces.

#7286 is definitely a clippy bug

changelog: none

3 years agoFix ICE in `too_many_lines` due to wrong assumptions on braces.
Jason Newcomb [Thu, 27 May 2021 19:16:26 +0000 (15:16 -0400)]
Fix ICE in `too_many_lines` due to wrong assumptions on braces.

3 years agoSimplify collect expr_ty
Cameron Steffen [Fri, 28 May 2021 01:54:56 +0000 (20:54 -0500)]
Simplify collect expr_ty

3 years agoFix needless_collect with binding shadowing
Cameron Steffen [Fri, 28 May 2021 01:39:20 +0000 (20:39 -0500)]
Fix needless_collect with binding shadowing

3 years agoDo not lint use_self on type parameters
Cameron Steffen [Thu, 27 May 2021 21:25:37 +0000 (16:25 -0500)]
Do not lint use_self on type parameters

3 years agoSome cleanup for use_self
Cameron Steffen [Thu, 27 May 2021 21:10:35 +0000 (16:10 -0500)]
Some cleanup for use_self

3 years agoAuto merge of #7285 - camsteffen:mini-macro-move, r=flip1995
bors [Thu, 27 May 2021 17:19:39 +0000 (17:19 +0000)]
Auto merge of #7285 - camsteffen:mini-macro-move, r=flip1995

Move mini-macro to tests/ui/auxilary

changelog: none

Merges `/mini-macro` into `/tests/ui/auxilary/proc_macro_derive.rs`.

The mini-macro crate is an artifact of the distant past. A lot has changed (#2284) and it doesn't make sense as a top-level crate anymore. Especially since we can use the auxilary folder to accompolish the same thing.

3 years agoMove mini-macro to auxilary
Cameron Steffen [Thu, 27 May 2021 16:03:13 +0000 (11:03 -0500)]
Move mini-macro to auxilary

3 years agoAuto merge of #7284 - camsteffen:consts-reexport, r=flip1995
bors [Thu, 27 May 2021 14:07:12 +0000 (14:07 +0000)]
Auto merge of #7284 - camsteffen:consts-reexport, r=flip1995

Remove clippy_utils::consts re-export

changelog: none

We got a straggler.

3 years agoRemove clippy_utils::consts re-export
Cameron Steffen [Thu, 27 May 2021 13:49:37 +0000 (08:49 -0500)]
Remove clippy_utils::consts re-export

3 years agoAuto merge of #7283 - flip1995:release-doc, r=giraffate
bors [Thu, 27 May 2021 13:19:35 +0000 (13:19 +0000)]
Auto merge of #7283 - flip1995:release-doc, r=giraffate

Document to only push the created tag and not everything

Inspired by https://stackoverflow.com/a/5195913

changelog: none

3 years agoDocument to only push the created tag and not everything
flip1995 [Thu, 27 May 2021 09:09:49 +0000 (11:09 +0200)]
Document to only push the created tag and not everything

3 years agoAuto merge of #7281 - camsteffen:has-doc-fp, r=flip1995
bors [Thu, 27 May 2021 08:37:08 +0000 (08:37 +0000)]
Auto merge of #7281 - camsteffen:has-doc-fp, r=flip1995

Fix missing_docs_in_private_items false negative

changelog: Fix [`missing_docs_in_private_items`] false negative when the item has any `#[name = "value"]` attribute

Closes #7247 (decided not to use the rustc method since it calls `Session::check_name`, which is for rustc only)

3 years agoAuto merge of #7282 - camsteffen:lint-stmt-expr, r=flip1995
bors [Thu, 27 May 2021 08:23:21 +0000 (08:23 +0000)]
Auto merge of #7282 - camsteffen:lint-stmt-expr, r=flip1995

Fix allow on some statement lints

changelog: Fix `#[allow(..)]` over statements for [`needless_collect`], [`short_circuit_statement`] and [`unnecessary_operation`]

Fixes #7171
Fixes #7202

3 years agoAuto merge of #7187 - camsteffen:avoid-break-exported, r=flip1995,phansch
bors [Thu, 27 May 2021 04:49:56 +0000 (04:49 +0000)]
Auto merge of #7187 - camsteffen:avoid-break-exported, r=flip1995,phansch

Add avoid_breaking_exported_api config option

changelog: Add `avoid_breaking_exported_api` config option for [`enum_variant_names`], [`large_types_passed_by_value`], [`trivially_copy_pass_by_ref`], [`unnecessary_wraps`], [`upper_case_acronyms`] and [`wrong_self_convention`].

changelog: Deprecates [`pub_enum_variant_names`] and [`wrong_pub_self_convention`] as the non-pub variants are now configurable.

changelog: Fix various false negatives for `pub` items that are not exported from the crate.

A couple changes to late passes in order to use `cx.access_levels.is_exported` rather than `item.vis.kind.is_pub`.

I'm not sure how to better document the config option or lints that are (not) affected (see comments in #6806). Suggestions are welcome. cc `@rust-lang/clippy`

I added `/clippy.toml` to use the config internally and `/tests/clippy.toml` to maintain a default config in ui tests.

Closes #6806
Closes #4504

3 years agoFix allow on some statement lints
Cameron Steffen [Thu, 27 May 2021 03:07:53 +0000 (22:07 -0500)]
Fix allow on some statement lints

3 years agoFix config file lookup
Cameron Steffen [Fri, 7 May 2021 17:07:59 +0000 (12:07 -0500)]
Fix config file lookup

3 years agoAdd deprecated lint tests
Cameron Steffen [Fri, 7 May 2021 16:19:35 +0000 (11:19 -0500)]
Add deprecated lint tests