289300 Commits

Author SHA1 Message Date
Philipp Krones
60750ca0a1
tempfile dep bump fallout 2025-05-15 19:55:43 +02:00
Philipp Krones
afa6d67f36
Update Cargo.lock 2025-05-15 19:30:30 +02:00
Philipp Krones
825a62af51
Merge commit '0450db33a5d8587f7c1d4b6d233dac963605766b' into clippy-subtree-update 2025-05-15 19:28:39 +02:00
Philipp Krones
0450db33a5
Rustup (#14815)
r? @ghost

changelog: none
2025-05-15 17:24:57 +00:00
Philipp Krones
367073195a
Bump Clippy version -> 0.1.89 2025-05-15 19:19:46 +02:00
Philipp Krones
5be888c479
Bump nightly version -> 2025-05-14 2025-05-15 19:19:34 +02:00
Philipp Krones
0bb1b5bd3b
Merge remote-tracking branch 'upstream/master' into rustup 2025-05-15 19:19:08 +02:00
bors
d163a28381 Auto merge of #141011 - matthiaskrgr:rollup-4uwllo2, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #140827 (Do not ICE when reassigning in GatherLocalsVisitor on the bad path)
 - #140904 (Add an issue template for future-incompatible lints)
 - #140953 (Fix a compiletest blessing message)
 - #140973 (Update rustix to 1.0.7 for bootstrap)
 - #140976 (Add `Ipv4Addr` and `Ipv6Addr` diagnostic items)
 - #140988 (MaybeUninit::write: fix doc)
 - #140989 (Suggest replace f with f: Box<f> when expr field is short hand)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-05-15 12:06:06 +00:00
bors
2a5da7acd4 Auto merge of #141023 - jieyouxu:temp-windows-server-2022, r=marcoieni
Temporarily use Windows Server 2022 instead of Windows Server 2025 images

Tracking issue: https://github.com/rust-lang/rust/issues/141022

At the moment, it seems like Windows Server 2025 20250504.1.0 is misconfigured, causing insufficient disk space failures. Temporarily go back to Windows Server 2022 in the hope that those are not also misconfigured to try to unblock the queue.

r? `@marcoieni` (or infra-ci)
2025-05-15 08:54:32 +00:00
Jieyou Xu
f4ce73ede2
Temporarily use Windows Server 2022 instead of Windows Server 2025 images
At the moment, it seems like Windows Server 2025 20250504.1.0 is
misconfigured causing insufficient disk space failures. Temporarily go
back to Windows Server 2022 in the hope that those are not also
misconfigured.
2025-05-15 16:34:22 +08:00
dswij
40bead02a5
clippy_dev refactor (#14616)
Based on rust-lang/rust-clippy#13223

Various refactoring on `clippy_dev` before upgrading rename and
splitting `clippy_lints` into multiple crates.

Some improvements:
* The working directory is set to the root clippy directory. Running
from a subdirectory was kind of supported before sometimes. Now it just
works.
* File won't be written unless they're actually updated. Most of the
time they weren't written, but a few cases slipped through.
* Buffers are reused more for the negligible speed boost.

changelog: None
2025-05-14 16:44:08 +00:00
Matthias Krüger
e39ab25bf4
Rollup merge of #140989 - xizheyin:issue-139631, r=compiler-errors
Suggest replace f with f: Box<f> when expr field is short hand

Fixes #139631

r? compiler
2025-05-14 18:43:40 +02:00
Matthias Krüger
8395461fa4
Rollup merge of #140988 - mathisbot:docfix_maybeuninit_write, r=tgross35
MaybeUninit::write: fix doc

# Fix doc for `MaybeUninit::write`

The documentation refers to the way `MaybeUninit` stores data internally. The property of not dropping content on context exit is the responsibility of `ManuallyDrop`.
2025-05-14 18:43:40 +02:00
Matthias Krüger
a1b5841bcc
Rollup merge of #140976 - samueltardieu:diag-ipaddr-v4v6, r=Urgau
Add `Ipv4Addr` and `Ipv6Addr` diagnostic items

They will be used in Clippy to detect runtime parsing of known-valid IP addresses.
2025-05-14 18:43:39 +02:00
Matthias Krüger
bbd2301a00
Rollup merge of #140973 - Berrysoft:update-bootstrap-lock, r=jieyouxu
Update rustix to 1.0.7 for bootstrap

Another bump for bootstrap. Finally it compiles on Cygwin:) Hooray!

r? ``@jieyouxu``
2025-05-14 18:43:39 +02:00
Matthias Krüger
8e34100014
Rollup merge of #140953 - jieyouxu:compiletest-bless-msg, r=compiler-errors
Fix a compiletest blessing message

It was showing compare mode instead of test name.

Fixes #140945.
Noticed in https://github.com/rust-lang/rust/pull/140622#issuecomment-2868705612.
2025-05-14 18:43:38 +02:00
Matthias Krüger
0267905eee
Rollup merge of #140904 - ehuss:future-incompat-template, r=Mark-Simulacrum
Add an issue template for future-incompatible lints

This adds a GitHub issue template for future-incompatible lints. Most of the existing tracking issues have been using different formats with different information, and I think it would be helpful to make them a little more consistent and to ensure that sufficient information is provided.

Some comments on my choices:
* Added a dedicated section to describe *why* the change is being made. Many existing issues already have this, so let's standardize on it.
* Have a section with a very clear example. Almost all of the existing issues have this in one form or another.
* Added a "Recommendations" section, since this is something I see missing in several of the existing issues, and this is really important information IMHO.
* I reworded the "When" section. The existing template mentioned that these get reviewed every 6 weeks which my understanding is not true. That's also not very helpful information to the user, since it doesn't really answer the question. I'm not sure this section will actually be useful since I suspect most of the time we don't know when it will change (there have been a few exceptions).
* Clearly show the expected progression steps. Several issues already have this.
* Added implementation history, which is useful for linking PRs. (IDK, this could get merged with "Steps".)
2025-05-14 18:43:38 +02:00
Matthias Krüger
dcb808e48b
Rollup merge of #140827 - compiler-errors:gather-locals-twice, r=oli-obk
Do not ICE when reassigning in GatherLocalsVisitor on the bad path

Fixes https://github.com/rust-lang/rust/issues/140785
Fixes https://github.com/rust-lang/rust/issues/140730

See comment in code.

r? oli-obk
2025-05-14 18:43:37 +02:00
llogiq
1a864f34a3
Add the allow_exact_repetitions option to the module_name_repetititions lint (#14261)
changelog: [`module_name_repetitions`]: new configuration option
`allow_exact_repetitions`, enabled by default

Closes #14226
2025-05-14 10:17:45 +00:00
SLUCHABLUB
488e4e53d2 Add the allow_exact_repetitions option to the module_name_repetitions lint. 2025-05-14 10:49:01 +02:00
Samuel Tardieu
7b1ba425e7 Add Ipv4Addr and Ipv6Addr diagnostic items
They will be used in Clippy to detect runtime parsing of known-valid
IP addresses.
2025-05-14 09:34:25 +02:00
xizheyin
32be459909
Suggest replace f with f: Box<f> when expr field is short hand
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-05-14 15:14:32 +08:00
xizheyin
dca57c6714
Add ui test suggest-box-for-expr-field-issue-139631
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-05-14 15:08:17 +08:00
Mathis Bottinelli
c610177558 MaybeUninit::write: fix doc 2025-05-14 09:02:22 +02:00
Jason Newcomb
373df5265e
Post non_std_lazy_statics type warnings onto the right node (#14740)
When a `non_std_lazy_statics` warning is generated about an item type
which can be replaced by a standard library one, ensure that the lint
happens on the item HIR node so that it can be expected.

changelog: [`non_std_lazy_statics`]: generate the warning onto the right
node

Fixes rust-lang/rust-clippy#14729

Note that this doesn't change anything on lints generated for the
`lazy_static::lazy_static` macro because the `expect` attribute cannot
be applied to a macro.
2025-05-14 05:49:50 +00:00
王宇逸
4fcd33c318 Update rustix to 1.0.7 for bootstrap 2025-05-14 00:45:55 +08:00
llogiq
17f2a87c0c
Add internal lint derive_deserialize_allowing_unknown (#14360)
Adds an internal lint to check for `#[derive(serde::Deserialize)]`
without
[`#[serde(deny_unknown_fields)]`](https://serde.rs/container-attrs.html#deny_unknown_fields).

Today, if you run Clippy with the following clippy.toml, Clippy will
produce a warning, but there will be no accompanying note:
```toml
# In the following configuration, "recommendation" should be "reason" or "replacement".
disallowed-macros = [
    { path = "std::panic", recommendation = "return a `std::result::Result::Error` instead" },
]
```
```sh
$ cargo clippy
    Checking a v0.1.0 (/home/smoelius/tmp/a)
warning: use of a disallowed macro `std::panic`
 --> src/lib.rs:2:5
  |
2 |     panic!();
  |     ^^^^^^^^
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#disallowed_macros
  = note: `#[warn(clippy::disallowed_macros)]` on by default
```
The underlying problem is: the enum that derives `serde::Deserialize`
([`DisallowedPathEnum`](81643e297c/clippy_config/src/types.rs (L47)))
does not have the attribute `#[serde(deny_unknown_fields)]`.

This lint identifies such problems by checking trait `impl`s. An
alternative I considered was to walk `clippy_config::conf::Conf`
directly. However, that would not catch the `DisallowedPathEnum` case
because it [is not used in `Conf`
directly](81643e297c/clippy_config/src/types.rs (L31)).

Just to be clear, no one asked for this. So I hope the maintainers do
not mind.

changelog: none
2025-05-13 15:36:57 +00:00
Samuel Moelius
9f4ecea242 Add internal lint derive_deserialize_allowing_unknown 2025-05-13 10:48:41 -04:00
bors
414482f6a0 Auto merge of #140921 - Berrysoft:update-rustc-lock, r=jieyouxu
Update `ctrlc`, `libloading` and `nix` for rustc

The main purpose is to update `nix` to 0.30.1. It adds support for cygwin.
2025-05-13 13:06:57 +00:00
bors
4eca99a18e Auto merge of #140887 - pietroalbini:pa-bootstrap-update, r=compiler-errors
Stage0 bootstrap update

This PR [follows the release process](https://forge.rust-lang.org/release/process.html#master-bootstrap-update-tuesday) to update the stage0 compiler.

The only thing of note is 58651d1b31, which was flagged by clippy as a correctness fix. I think allowing that lint in our case makes sense, but it's worth to have a second pair of eyes on it.

r? `@Mark-Simulacrum`
2025-05-13 09:54:28 +00:00
Michael Goulet
8ce7783c7c
Format and skip formatting for pin 2025-05-13 11:30:39 +02:00
Pietro Albini
ce6e29679c
bump compiler_builtins 2025-05-13 11:30:36 +02:00
bors
f6b5da71ea Auto merge of #140951 - compiler-errors:super-fmt, r=ytmimi
Do not remove `super` keyword from `super let`

This is affecting a macro in the standard library:

bc7512ee63/library/core/src/pin.rs (L1945)

I added an exception in 6f6a9a585891d0a2d1114a7a621f35f28f39c0d9, but I'd like to remove it eventually, so opening this in-tree to not block this on the next rustfmt sync.

r? `@calebcartwright` or `@ytmimi`
2025-05-13 06:43:56 +00:00
llogiq
7bac114c86
Add new lint: cloned_ref_to_slice_refs (#14284)
Added lint for catching `&[foo.clone()]` where foo is a reference and
suggests `std::slice::from_ref(foo)`.

changelog: new lint: [`cloned_ref_to_slice_refs`]
2025-05-13 05:32:33 +00:00
bors
32d23857f1 Auto merge of #140935 - omahs:patch-5, r=jieyouxu
Fix typos

Fix typos
2025-05-13 03:33:22 +00:00
asdfish
40e1b0ed00 add lint cloned_ref_to_slice_refs
remove merge

removed false positive and improved tests

clarify known problems for `cloned_ref_to_slice_refs`
2025-05-12 21:12:58 -04:00
bors
3ae0b2e2ed Auto merge of #140927 - mejrs:test5, r=jieyouxu
chore: move more ui tests

r? `@jieyouxu`
2025-05-13 00:03:33 +00:00
Jason Newcomb
0636121964 clippy_dev: Remove print option from update_lints 2025-05-12 17:07:53 -04:00
Jason Newcomb
a9beb8b68d clippy_dev: Refactor token parsing to avoid macros. 2025-05-12 17:07:53 -04:00
Jason Newcomb
97abf33fa0 clippy_dev: Split gathering lint decls from parsing deprecated lints. 2025-05-12 17:07:53 -04:00
Jason Newcomb
2c85cb0371 clippy_dev: Only build AhoCorasick searcher once for multiple files. 2025-05-12 17:07:52 -04:00
Jason Newcomb
98cb92f323 clippy_dev: Reuse buffers when updating files and don't write unchanged files in clippy_dev 2025-05-12 17:07:52 -04:00
Jason Newcomb
3fe5fb2967 clippy_dev: Split rename and deprecate out of update_lints 2025-05-12 17:07:52 -04:00
Jason Newcomb
2f39264d00 clippy_dev: Set the current directory to clippy's root path. 2025-05-12 17:07:52 -04:00
bors
8405332bdf Auto merge of #140909 - fmease:modern-notif-backport-rustdoc, r=apiraino
Use new form for T-rustdoc's {beta,stable}-{nominated,accepted} notify-Zulip triggers

Applies [#t-rustdoc > PSA: New actions on backport notifs @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/PSA.3A.20New.20actions.20on.20backport.20notifs/near/514823133).
Complements #140397.

r? `@apiraino` or T-triagebot
2025-05-12 20:50:11 +00:00
Philipp Krones
bfc6ad0340
Do not use clippy_utils from UI tests (#14788)
changelog: none

r? @flip1995
2025-05-12 19:32:40 +00:00
Philipp Krones
54aa120f18
Update "Changelog update walkthrough" section (#14785)
Update "Changelog update walkthrough" section based on
rust-lang/rust-clippy#14748 discussion

changelog: none
2025-05-12 19:29:36 +00:00
bors
1a7f290a9a Auto merge of #140914 - Zalathar:asm-bindings, r=compiler-errors
cg_llvm: Clean up some inline assembly bindings

This PR combines a few loosely-related cleanups to LLVM bindings related to inline assembly. These include:
- Replacing `LLVMRustInlineAsm` with LLVM-C's `LLVMGetInlineAsm`
- Adjusting FFI declarations to avoid the need for explicit `as_c_char_ptr` conversions
- Flattening control flow in `inline_asm_call`

There should be no functional changes.
2025-05-12 17:39:21 +00:00
omahs
1caaa88700 Fix typos 2025-05-12 17:20:49 +00:00
Alexey Semenyuk
2215282fa4 Update Changelog update walkthrough docs section 2025-05-12 22:15:53 +05:00