Commit Graph

19211 Commits

Author SHA1 Message Date
lucarlig
d84d9d32f1 lint on variant and fields as well 2024-02-25 22:33:16 +04:00
bors
10c99031ce Auto merge of #12348 - Alexendoo:remove-get-parent-node, r=y21
Remove `clippy_utils::get_parent_node`

Since it's forwarding to a single method it seems reasonable to use that one directly instead

changelog: none
2024-02-25 17:43:59 +00:00
lucarlig
f066be7e1e use span of fragments 2024-02-25 21:31:46 +04:00
lucarlig
d7ad85f521 move the the check into check_atr function 2024-02-25 21:26:43 +04:00
lucarlig
f32e92cdc9 add 1 more test and dont trim other code 2024-02-25 21:18:38 +04:00
Alex Macleod
bee4111a61 Remove clippy_utils::get_parent_node 2024-02-25 16:35:17 +00:00
y21
9a56153c5e [single_call_fn]: merge post-crate visitor into lint pass 2024-02-25 17:13:47 +01:00
bors
c469cb0023 Auto merge of #12336 - not-elm:fix/issue-12243, r=y21
FIX(12243): redundant_guards

Fixed #12243

changelog: Fix[`redundant_guards`]

I have made a correction so that no warning does  appear when y.is_empty() is used within a constant function as follows.

```rust
pub const fn const_fn(x: &str) {
    match x {
        // Shouldn't lint.
        y if y.is_empty() => {},
        _ => {},
    }
}
```
2024-02-25 14:56:07 +00:00
lucarlig
5a50cede29 add single letter test 2024-02-25 18:01:53 +04:00
lucarlig
97e4c57f24 fix lint doc 2024-02-25 17:51:58 +04:00
lucarlig
ee0cbeaa77 ignore empty comment in semicolon_if_nothing_returned 2024-02-25 17:41:41 +04:00
lucarlig
0ea449597e pop before trimming 2024-02-25 17:23:15 +04:00
lucarlig
9ac6125e1d add extra variant because no more than 3 bools 2024-02-25 17:16:07 +04:00
lucarlig
a3fea80a68 bless tests 2024-02-25 17:04:58 +04:00
lucarlig
09c7c5d2c9 fix bug in check_exprs 2024-02-25 16:52:58 +04:00
lucarlig
84219f45a3 working naive with outside check_attrs 2024-02-25 16:11:14 +04:00
bors
76e4864119 Auto merge of #12339 - GuillaumeGomez:add-unnecessary_get_then_check, r=llogiq
Add new `unnecessary_get_then_check` lint

No issue linked to this as far as I can see. It's a lint I discovered that could be added when I worked on another lint.

r? `@llogiq`

changelog: Add new `unnecessary_get_then_check` lint
2024-02-25 10:39:24 +00:00
bors
8ef1b73442 Auto merge of #12346 - klensy:itertools-bump, r=llogiq
bump itertools to 0.12

Bumps itertools to newer 0.12 version, https://github.com/rust-itertools/itertools/blob/v0.12.1/CHANGELOG.md

changelog: none
2024-02-25 10:25:16 +00:00
klensy
cdaccd7fce bump itertools to 0.12 2024-02-25 13:14:07 +03:00
bors
0d1ba48cb4 Auto merge of #12345 - xFrednet:00000-some-healthy-life-choices, r=xFrednet
Pause PR assignments for xFrednet :)

My life is currently a bit chaotic, and it feels like I can't give reviews the attention they need. I'll finish the PRs I'm assigned to, write the changelogs, and am available when I get pinged etc.

This is only intended as a temporary pause, as I still genuinely enjoy working with everyone in this repo and seeing Clippy grow day by day.

---

changelog: none

r? `@ghost`
2024-02-25 09:57:59 +00:00
xFrednet
6b7700ef49
Pause PR assignments for xFrednet :) 2024-02-25 10:18:55 +01:00
not-elm
5a63cd82cb FIX(12243): redundant_guard
A warning is now suppressed when "<str_va> if <str_var>.is_empty" is used in a constant function.

FIX: instead of clippy_util::in_const

FIX: Merged `redundant_guards_const_fn.rs` into `redundant_guards.rs`.
2024-02-25 15:38:18 +09:00
lucarlig
3093b291f6 WIP: empty doc span is still broken 2024-02-25 09:55:58 +04:00
Guillaume Gomez
5e2707d343 Fix new lint warnings 2024-02-24 15:02:10 +01:00
Guillaume Gomez
a1971414ec Update ui tests 2024-02-24 15:02:10 +01:00
Guillaume Gomez
40cff2d99f Add ui test for unnecessary_get_then_check 2024-02-24 15:02:10 +01:00
Guillaume Gomez
ad319484f1 Add new unnecessary_get_then_check clippy lint 2024-02-24 15:02:10 +01:00
bors
a2c1d565e5 Auto merge of #12259 - GuillaumeGomez:multiple-bound-locations, r=llogiq
Add new `multiple_bound_locations` lint

Fixes #7181.

r? `@llogiq`

changelog: Add new `multiple_bound_locations` lint
2024-02-24 13:43:34 +00:00
bors
64054693eb Auto merge of #12322 - sanxiyn:expression-with-attribute, r=llogiq
Be careful with expressions with attributes

Fix #9949.

changelog: [`unused_unit`]: skip expressions with attributes
2024-02-24 10:52:55 +00:00
bors
0597838892 Auto merge of #12260 - Jarcho:issue_12255, r=llogiq
Take lifetime extension into account in `ref_as_ptr`

fixes #12255

This should be merged upstream as well. Changing `let x = &temp as *const _` into `let x = from_ref(&temp)` is UB.

changelog: `ref_as_ptr`: Take lifetime extension into account
2024-02-24 04:28:53 +00:00
Jason Newcomb
5ab42d8e6a Take lifetime extension into account in ref_as_ptr 2024-02-23 21:33:53 -05:00
Guillaume Gomez
762448bc55 Update ui tests 2024-02-23 17:38:39 +01:00
J-ZhengLi
929f746b5c fix the actual bug 2024-02-24 00:35:48 +08:00
Guillaume Gomez
6955a8ac4e Add ui test for multiple_bound_locations lint 2024-02-23 16:40:21 +01:00
Guillaume Gomez
d654acd554 Add new multiple_bound_locations lint 2024-02-23 13:22:21 +01:00
J-ZhengLi
0d83a3a18b re-orgnize [useless_vec]'s code 2024-02-23 16:51:07 +08:00
bors
5a52c8aee9 Auto merge of #12333 - MarcusGrass:issue-12223, r=Manishearth
Allow unused_imports, and unused_import_braces on `use`

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

Both `unused_import_braces` and `unused_imports` are valid on `use`-items, additional to the two previously allowed.

changelog: [`useless_attribute`]: Allow `rustc_lint` `unused_import_braces` and `unused_imports` on `use`-items
2024-02-22 22:47:03 +00:00
MarcusGrass
f1974593c9
Remove double unused_imports check 2024-02-22 23:12:38 +01:00
MarcusGrass
97a3ac5b86
Allow unused_imports, and unused_import_braces on use 2024-02-22 21:53:04 +01:00
bors
341ae30a85 Auto merge of #12332 - blyxyas:not-on-vacation, r=blyxyas
Coming back to reviewer rotation

After this current CPP period, in which I set myself as on-vacation to focus on performance, I'm now available again. I'd love if my vacation status wasn't present in version control

changelog:none
r? ghost
2024-02-22 16:06:38 +00:00
blyxyas
c6a720f2f2
Coming back to reviewer rotation 2024-02-22 16:41:01 +01:00
bors
379342cf7a Auto merge of #12331 - flip1995:rustup, r=flip1995
Rustup

r? `@ghost`

changelog: none
2024-02-22 15:38:27 +00:00
Philipp Krones
8a58b7613d
Update i686 asm test stderr 2024-02-22 16:27:24 +01:00
Philipp Krones
cc6dcaae57
Use Level::from_symbol in unnecessary_clippy_cfg 2024-02-22 16:07:28 +01:00
Philipp Krones
6591dc683e
Bump nightly version -> 2024-02-22 2024-02-22 15:59:39 +01:00
Philipp Krones
dc0bb69e66
Merge remote-tracking branch 'upstream/master' into rustup 2024-02-22 15:59:29 +01:00
bors
d554bcad79 Auto merge of #12303 - GuillaumeGomez:unneedeed_clippy_cfg_attr, r=flip1995
Add `unnecessary_clippy_cfg` lint

Follow-up of https://github.com/rust-lang/rust-clippy/pull/12292.

r? `@flip1995`

changelog: Add `unnecessary_clippy_cfg` lint
2024-02-22 11:00:52 +00:00
Guillaume Gomez
cf6a14cea1 Add ui test for unneeded_clippy_cfg_attr 2024-02-22 11:55:31 +01:00
Guillaume Gomez
f35d87f211 Add unneeded_clippy_cfg_attr lint 2024-02-22 11:52:58 +01:00
bors
422f9c5b65 Auto merge of #12317 - CBSpeir:issue_12291, r=y21
Add check for 'in_external_macro' and 'is_from_proc_macro' inside

changelog: Fix #12291 #[tracing::instrument()] triggers infinite_loop

Added an in_external_macro and is_from_proc_macro check to the [infinite_loop] lint
2024-02-21 22:53:46 +00:00