Commit Graph

303456 Commits

Author SHA1 Message Date
Rafael Bachmann
0f418520c6 Fix formatting nit in process.rs 2025-03-28 13:22:09 +01:00
Yotam Ofek
9ef35ddc0c use slice::contains where applicable 2025-03-28 12:21:21 +00:00
Yotam Ofek
827cb1b2a7 use try_fold instead of fold 2025-03-28 12:14:09 +00:00
Matthias Krüger
310bebc487 Rollup merge of #139047 - m-ou-se:remove-scope-depth, r=oli-obk
Remove ScopeDepth

The scope depth was tracked, but never seemed to be used for anything.

Every single place that used `(Scope, ScopeDepth)`, matched it on `(p, _)`.
2025-03-28 12:59:58 +01:00
Matthias Krüger
ea56904feb Rollup merge of #139045 - onur-ozkan:less-verbose-bootstrap-test, r=Kobzol
bootstrap: update `test_find` test

`cc::Build::get_archiver` is noisy on the `arm-linux-androideabi` target and constantly printing `llvm-ar --version` output during bootstrap tests on all platforms.
2025-03-28 12:59:58 +01:00
Matthias Krüger
5261a0aedf Rollup merge of #139038 - adamgreig:thumb-target-maintainers, r=Noratrieb
Update target maintainers for thumb targets to reflect new REWG Arm team name

Closes #139027

The name of the team responsible for these targets has changed as the team was merged with other Arm-related teams (see https://github.com/rust-embedded/wg/pull/818). The link gives an up-to-date list of github usernames that can be pinged, whereas the old email address is not very actively maintained or tracked.
2025-03-28 12:59:57 +01:00
Matthias Krüger
60833b1475 Rollup merge of #138986 - Shourya742:2025-03-25-add-ignore-to-change-id, r=Kobzol
feat(config): Add ChangeId enum for suppressing warnings

closes: #138925
2025-03-28 12:59:56 +01:00
Matthias Krüger
bdc5adfe78 Rollup merge of #138678 - durin42:rmeta-stability, r=fmease
rustc_resolve: fix instability in lib.rmeta contents

rust-lang/rust@23032f31c9 accidentally introduced some nondeterminism in the ordering of lib.rmeta files, which we caught in our bazel-based builds only recently due to being further behind than normal. In my testing, this fixes the issue.
2025-03-28 12:59:55 +01:00
Matthias Krüger
ad87732cae Rollup merge of #138104 - GuillaumeGomez:simplify-doctest-parsing, r=fmease
Greatly simplify doctest parsing and information extraction

The original process was pretty terrible, as it tried to extract information such as attributes by performing matches over tokens like `#!`, which doesn't work very well considering you can have `#   ! [`, which is valid.

Also, it now does it in one pass: if the parser is happy, then we try to extract information, otherwise we return early.

r? `@fmease`
2025-03-28 12:59:55 +01:00
Matthias Krüger
9597bf72dd Rollup merge of #137889 - mu001999-contrib:update-doc, r=wesleywiser
update outdated doc with new example

update the illegal definition example because we can compile `struct Ref<'a, T> { x: &'a T }` ([play](https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=2eb2f8800d423c316b545c864623ae16))
2025-03-28 12:59:54 +01:00
Samuel Tardieu
4ac3611225 implicit_return: do not suggest adding return into desugared code
Blocks created by desugaring will not contain an explicit `return`. Do not
suggest to add it when the user has no control over the desugared code.

Also, in the case of an implicit return on a `.await` expression, ensure
that the suggested `return` is emitted at the right place instead of
before the `await` keyword.
2025-03-28 12:14:43 +01:00
Samuel Tardieu
8357d06310 Factor out clippy_utils::get_async_closure_expr()
Also, be stricter in matching the right expansion of async closures.
2025-03-28 12:14:43 +01:00
Ralf Jung
024c8c3063 cache mangle_internal_symbol results 2025-03-28 12:07:33 +01:00
Alejandra González
d78622eeb8 Make missing_const_for_fn operate on non-optimized MIR (#14003)
The main reason for this is that we might transform MIR in the
optimization passes in a way that doesn't work with const-eval, but it
is irrelevant since const-eval uses another MIR (`mir_for_ctfe`).

Specifically this came up when adding a new check in debug builds
(https://github.com/rust-lang/rust/pull/134424), which is added as part
of an optimization pass.

changelog: none
2025-03-28 11:01:32 +00:00
Bastian Kersting
3e960c12d8 Make missing_const_for_fn operate on non-optimized MIR
This has two reasons: First of all we don't need the optimized MIR for
evaluating the checks of this lint, as const-eval anyways operates on
`mir_for_ctf` which is derived from `mir_drops_elaborated_and_const_checked`.
Second of all we might transform MIR in the optimization passes in a way
that doesn't work with const-eval, but it is irrelevant since const-eval
uses another MIR.

Specifically this came up when adding a new check in debug builds
(https://github.com/rust-lang/rust/pull/134424), which is added as part
of an optimization pass.
2025-03-28 10:46:41 +00:00
Hegui Dai
40fc228443 update test 2025-03-28 18:28:56 +08:00
Hegui Dai
753cdd7ade move "impl<> for <>" and test about it 2025-03-28 18:25:32 +08:00
bors
de1dd8beee Auto merge of #138503 - bjorn3:string_merging, r=tmiasko
Avoid wrapping constant allocations in packed structs when not necessary

This way LLVM will set the string merging flag if the alloc is a nul terminated string, reducing binary sizes.

try-job: armhf-gnu
2025-03-28 10:18:32 +00:00
bors
2a06022951 Auto merge of #138503 - bjorn3:string_merging, r=tmiasko
Avoid wrapping constant allocations in packed structs when not necessary

This way LLVM will set the string merging flag if the alloc is a nul terminated string, reducing binary sizes.

try-job: armhf-gnu
2025-03-28 10:18:32 +00:00
Samuel Tardieu
a1e1960efc Move desugar_await to clippy_utils 2025-03-28 11:09:40 +01:00
Guillaume Gomez
87d524bef6 Update coverage-run-rustdoc output 2025-03-28 10:35:53 +01:00
bjorn3
2f5aa084c8 Avoid wrapping constant allocations in packed structs when not necessary
This way LLVM will set the string merging flag if the alloc is a nul
terminated string, reducing binary sizes.
2025-03-28 09:19:57 +00:00
bjorn3
5c82a59bd3 Add test and comment 2025-03-28 09:19:57 +00:00
bjorn3
a5fa12b6b9 Avoid wrapping constant allocations in packed structs when not necessary
This way LLVM will set the string merging flag if the alloc is a nul
terminated string, reducing binary sizes.
2025-03-28 09:19:57 +00:00
Mara Bos
c41476034d Put pin!() tests in the right file. 2025-03-28 10:18:04 +01:00
Philipp Krones
c2922d1213 Make collapsible_if recognize the let_chains feature (#14481)
Until `if let` chains are stabilized, we do not collapse them together
or with other `if` expressions unless the `let_chains` feature is
enabled. This is the case for example in Clippy sources.

This was made possible by converting the `collapsible_if` to a late lint
to get access to the set of enabled features. This allows this PR to
supersede #14455 and no longer require an additional configuration
option.

The three commits are, in order:
- a conversion of the existing early lint to a late lint, with no new
feature or tests changes
- the addition of the `let_chains` feature detection and action, and
tests
- the application of the enhanced lint to Clippy sources (136 files
modified)

changelog: [`collapsible_if`]: recognize the rust compiler `let_chains`
feature

r? @flip1995
2025-03-28 09:17:24 +00:00
Lukas Wirth
8244095473 Merge pull request #19375 from ChayimFriedman2/do-not-complete
feat: Allow crate authors to control completion of their things
2025-03-28 09:06:19 +00:00
Mara Bos
deeac1c588 Remove outdated comment. 2025-03-28 08:36:16 +01:00
Mara Bos
3a9a5770ef Remove ScopeDepth entirely.
The scope depth was tracked, but never actually used for anything.
2025-03-28 08:31:47 +01:00
onur-ozkan
d5f7e71d5c bootstrap: update test_find test
`cc::Build::get_archiver` is noisy on the `arm-linux-androideabi` target and
constantly printing `llvm-ar --version` output during bootstrap tests on all platforms.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-03-28 10:15:51 +03:00
bors
e77a8f439c Auto merge of #139037 - jhpratt:rollup-4c74y8a, r=jhpratt
Rollup of 6 pull requests

Successful merges:

 - #138720 (Specify a concrete stack size in channel tests)
 - #139010 (Improve `xcrun` error handling)
 - #139021 (std: get rid of pre-Vista fallback code)
 - #139025 (Do not trim paths in MIR validator)
 - #139026 (Use `abs_diff` where applicable)
 - #139030 (saethlin goes on vacation)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-28 06:28:48 +00:00
bors
3f690c2257 Auto merge of #138965 - nnethercote:less-kw-Empty-hir-Lifetime, r=lcnr
Remove `kw::Empty` uses from `hir::Lifetime::ident`

`hir::Lifetime::ident` is sometimes set to `kw::Empty` and it's really confusing. This PR stops that. Helps with #137978.

r? `@lcnr`
2025-03-28 03:20:06 +00:00
Nicholas Nethercote
78768361a0 Remove rustc_middle::ty::util::ExplicitSelf.
It's an old (2017 or earlier) type that describes a `self` receiver.
It's only used in `rustc_hir_analysis` for two error messages, and much
of the complexity isn't used. I suspect it used to be used for more
things.

This commit removes it, and moves a greatly simplified version of the
`determine` method into `rustc_hir_analysis`, renamed as
`get_self_string`. The big comment on the method is removed because it
no longer seems relevant.
2025-03-28 14:15:46 +11:00
Mads Marquart
7a6a3241ca bootstrap: Update download-ci-llvm-stamp
This PR makes a fairly large version update to CMake and cc, so it is
likely that LLVM is built differently.
2025-03-28 04:15:41 +01:00
Mads Marquart
011eabd690 bootstrap: Override CMAKE_OSX_SYSROOT when building compiler-rt
Similarly to what was previously done for the `llvm` step.
2025-03-28 04:15:41 +01:00
Mads Marquart
e8704e899c bootstrap: Set CMAKE_SYSTEM_NAME=Darwin on Apple platforms
compiler-rt's CMake setup seems to have special logic for Apple
platforms that works poorly when this is not set.
2025-03-28 04:15:41 +01:00
Mads Marquart
a9cb15d793 bootstrap: Fix CMAKE_OSX_ARCHITECTURES on all Apple platforms 2025-03-28 04:15:41 +01:00
Mads Marquart
9cf05b893d bootstrap: Always set CMAKE_SYSTEM_NAME when cross-compiling
To avoid a panic in cmake-rs that was introduced in:
https://github.com/rust-lang/cmake-rs/pull/158
2025-03-28 04:15:41 +01:00
Mads Marquart
c83504faef bootstrap: bump cc to 1.2.17 and cmake to 0.1.54 2025-03-28 04:15:41 +01:00
bit-aloo
b24083bccc Add new change-id option in bootstrap.example.toml and update the change-id description references 2025-03-28 08:40:24 +05:30
David Barsky
c2ce9a9d7d Merge pull request #19466 from ChayimFriedman2/bug-coherence
fix: Fix a bug in orphan rules calculation
2025-03-28 02:53:14 +00:00
Chayim Refael Friedman
14410b6369 Fix a bug in orphan rules calculation
Where a fundamental type applied twice wasn't considered local.
2025-03-28 05:37:29 +03:00
Eric Huss
f535922f20 Try to more clearly specify exactly what the runtool flags do 2025-03-27 19:07:17 -07:00
Eric Huss
af2b4b94ed Show an example of using multiple ignore attributes 2025-03-27 19:07:17 -07:00
Eric Huss
7251b466a4 Remove and stabilize --enable-per-target-ignores
This removes the `--enable-per-target-ignores` and enables it
unconditionally.
2025-03-27 19:06:48 -07:00
Eric Huss
6441701e5c Stabilize --test-runtool and --test-runtool-arg 2025-03-27 19:04:56 -07:00
Eric Huss
ec25e3300b Rename --runtool and --runtool-arg
This renames `--runtool` and `--runtool-arg` to `--test-runtool` and
`--test-runtool-arg` to maintain consistency with other `--test-*`
arguments.
2025-03-27 19:04:56 -07:00
Eric Huss
0340a865b9 Add test for doctest runtool 2025-03-27 19:04:56 -07:00
Adam Greig
3b7d59ad12 Update target maintainers for thumb targets to reflect new REWG Arm team name 2025-03-28 01:54:35 +00:00
Jacob Pratt
63718922df Rollup merge of #139030 - saethlin:vacation, r=Noratrieb
saethlin goes on vacation

Someone should bug me in about 2 weeks if I don't remember to undo this
2025-03-27 21:41:50 -04:00