Commit graph

298901 commits

Author SHA1 Message Date
Urgau
9b3abe79d7 Use more subdiagnostics and reword the overloaded deref note 2025-05-14 23:53:40 +02:00
Samuel Tardieu
fe4b4e8329
mem::size_of_val is const-stable since Rust 1.85 2025-05-14 23:38:37 +02:00
Samuel Tardieu
4ec219393a
Fix size computation when element is a slice
In this case, a dereference is needed before using `mem::size_of_val()`.
2025-05-14 23:38:37 +02:00
Chayim Refael Friedman
de51196bb1 Don't allow duplicate crates in the all_crates list
For some reason we had them in some projects, I'm not sure why. But this caused cache priming to appear stuck - because it uses a set of crate IDs for the actual work, but for the number of crates to index it just uses `db.all_crates().len()`.
2025-05-14 21:38:40 +03:00
Guillaume Gomez
0d25090d26 Improve code and apply suggestions 2025-05-14 19:05:05 +02:00
Federico Terzi
e0b6363974 wire up startupinfo methods 2025-05-14 19:00:56 +02:00
Urgau
ac1df15f86 Improve dangerous_implicit_aurorefs diagnostic output 2025-05-14 18:58:38 +02: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
Guillaume Gomez
d5c5a8251d Update src/gcc submodule to 04ce66d8c918de9273bd7101638ad8724edf5e21 2025-05-14 18:02:02 +02:00
Guillaume Gomez
3cec08a47e Update gcc version used in rustc_codegen_version 2025-05-14 18:00:19 +02:00
Guillaume Gomez
7a47a6a9c7 Update gcc version used in rustc_codegen_version 2025-05-14 18:00:19 +02:00
Emmanuel Ferdman
754b06f978
Migrate to modern datetime API
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
2025-05-14 08:41:30 -07:00
Hayashi Mikihiro
6274d461cf fix: Removing all unused imports removes used imports for imports used for Derive macros
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-05-14 23:51:23 +09:00
Trevor Gross
65117eeda8 Skip {f32,f64}::mul_add tests on MinGW
Per [1], MinGW has an incorrect fma implementation. This showed up in
tests run with cranelift after adding float math operations to `core`.
Presumably we hadn't noticed this when running tests with LLVM because
LLVM was constant folding the result away.

Rust issue: https://github.com/rust-lang/rust/issues/140515

[1]: https://sourceforge.net/p/mingw-w64/bugs/848/
2025-05-14 14:30:03 +00:00
Trevor Gross
2b9256e1c8 Move applicable float tests from coretests back to std
The previous commit moved all test files from `std` to `core` so git
understands the move. Not all functionality is actually testable in
`core`, however, so perform move the relevant portions back. Changes
from inherent to module methods is also done since this is the form of
math operations available in `core` (as `core_float_math`).
2025-05-14 14:29:58 +00:00
Jamie
1267333ef1 Improve ternary operator recovery 2025-05-14 13:32:59 +01:00
Guillaume Gomez
d52b5e6df5 Merge commit '6ba33f5e11' into subtree-update_cg_gcc_2025-05-14 2025-05-14 13:51:02 +02:00
Guillaume Gomez
1c4ab86955 Merge commit '6ba33f5e11' into subtree-update_cg_gcc_2025-05-14 2025-05-14 13:51:02 +02:00
A4-Tacks
06da7b31ac
fixes: ide-assists, generate_new indent loses 2025-05-14 19:02:08 +08: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
antoyo
6ba33f5e11
Merge pull request #673 from rust-lang/sync_from_rust_2025_05_12
Sync from rust 2025/05/12
2025-05-14 06:00:41 -04:00
Li-yao Xia
66b2bf150c Fix link to GatherBorrows 2025-05-14 11:36:00 +02:00
Antoni Boucher
f38d6d0a8f Fix for xsave test on Intel SDE 2025-05-14 05:18:17 -04:00
Antoni Boucher
44af0a8b6c Stop ignoring test_mm512_stream_ps stdarch test 2025-05-14 05:17:25 -04:00
Antoni Boucher
878a1732bc Fix for the fminimum intrinsics 2025-05-14 05:00:18 -04:00
SLUCHABLUB
488e4e53d2 Add the allow_exact_repetitions option to the module_name_repetitions lint. 2025-05-14 10:49:01 +02:00
B I Mohammed Abbas
544c8ce535 Fix settimes for vxworks 2025-05-14 13:52:31 +05:30
B I Mohammed Abbas
e1f1878da5 Fix set_name for vxworks. Length of name should be truncated to VX_TASK_RENAME_LENGTH-1 2025-05-14 13:52:31 +05:30
Oli Scherer
e011c43bcf Merge mir query analysis invocations
The reasons I'm doing it is that

* merging those blocks allows for more parallelism as you don't run parallel blocks in sequence
* merging blocks allows merging analysis queries shrinking the dep graph
* should allow us to do more early aborting in case of errors and/or moving query calls from the analysis query into others that allow early aborting the others (and doing more tainting and stuff)
2025-05-14 08:04:56 +00: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
onur-ozkan
e0421f8f61 replace cc_detect::cc2ar with cc::try_get_archiver
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-05-14 07:31:56 +00: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
ismailarilik
85efae7302 Handle rustc_query_system cases of rustc::potential_query_instability lint 2025-05-14 08:59:55 +03: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
Michał Łowicki
b9f4350fbc fix doc for UnixStream 2025-05-13 22:00:56 -04:00
est31
7b45c59d40 Add match guard chains test for absence of compilation error
based on tests/ui/rfcs/rfc-2497-if-let-chains/temporary-early-drop.rs
2025-05-14 00:45:28 +02:00
Trevor Gross
48f3e63f70 Move float tests from std to core
Many float-related tests in `std` only depend on `core`, so move the
tests there. This also allows us to verify functions from
`core_float_math`.

Since the majority of test files need to be moved to `coretests`, move
the files here without any cleanup; this is done in a followup commit.
This makes git history slightly cleaner, but coretests will not build
immediately after this commit.
2025-05-13 22:22:15 +00:00
Trevor Gross
36790d2881 Initial implementation of core_float_math
Since [1], `compiler-builtins` makes a certain set of math symbols
weakly available on all platforms. This means we can begin exposing some
of the related functions in `core`, so begin this process here.

It is not possible to provide inherent methods in both `core` and `std`
while giving them different stability gates, so standalone functions are
added instead. This provides a way to experiment with the functionality
while unstable; once it is time to stabilize, they can be converted to
inherent.

For `f16` and `f128`, everything is unstable so we can move the inherent
methods.

The following are included to start:

* floor
* ceil
* round
* round_ties_even
* trunc
* fract
* mul_add
* div_euclid
* rem_euclid
* powi
* sqrt
* abs_sub
* cbrt

These mirror the set of functions that we have in `compiler-builtins`
since [1].

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

[1]: https://github.com/rust-lang/compiler-builtins/pull/763
2025-05-13 22:08:18 +00:00
David Wood
febb16a40f
type_ir: add faster exit for types_may_unify 2025-05-13 16:47:10 +00:00
王宇逸
4fcd33c318 Update rustix to 1.0.7 for bootstrap 2025-05-14 00:45:55 +08:00
Stypox
f4bc4cd1fd
Add TRACING_ENABLED to Machine trait 2025-05-13 18:15:02 +02:00