Commit Graph

172099 Commits

Author SHA1 Message Date
Ralf Jung ca39636991 Rollup merge of #153526 - homersimpsons:chore/fix-LegacyKeyValueFormat-i686, r=marcoieni
Fix LegacyKeyValueFormat report from docker build: i686

Part of https://github.com/rust-lang/rust/pull/152305

r? @marcoieni
2026-03-28 13:15:49 +01:00
bors 79531c53de Auto merge of #154489 - Zalathar:rollup-wBQK8Wt, r=Zalathar
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#154357 (uefi: extend comment for TcpStream Send impl)
 - rust-lang/rust#154410 (Clean up the API for opening/checking incremental-compilation files )
 - rust-lang/rust#154081 (format safety doc of Rc/Arc::from_raw/from_raw_in)
 - rust-lang/rust#154110 (Change "error finalizing incremental compilation" text and emit it as a note, not a warning)
 - rust-lang/rust#154196 (Make `Ipv6Addr::multicast_scope()` exhaustive)
 - rust-lang/rust#154221 (`vec::as_mut_slice()`: use lowercase "isize" in safety comment)
 - rust-lang/rust#154234 (Use common Timestamp impl in Hermit (attempt 2))
 - rust-lang/rust#154396 (chore(deps): update rust crate tar to v0.4.45)
 - rust-lang/rust#154488 (Revert "Unstable book options parser")
2026-03-28 07:35:44 +00:00
Manuel Drehwald 0d3d1ac9b3 bootstrap: force a CI LLVM stamp bump 2026-03-28 05:11:48 +01:00
Manuel Drehwald a3261a2307 Revert "Link LLVM dynamically on aarch64-apple-darwin"
This reverts commit e7c268f883.
2026-03-28 05:11:48 +01:00
Manuel Drehwald 41c932c327 Revert "re-enable enzyme/autodiff builds on dist-aarch64-apple"
This reverts commit 988633d72c.
2026-03-28 05:11:48 +01:00
Stuart Cook e0a0ad188d Rollup merge of #154488 - Zalathar:unstable, r=jieyouxu
Revert "Unstable book options parser"

- Reverts https://github.com/rust-lang/rust/pull/154070

This reverts commit 6fd8466768, reversing changes made to fda6d37bb8.

---

The changes in https://github.com/rust-lang/rust/pull/154070 are well-intentioned, but in their current form they place an unreasonable maintenance burden on the affected part of the compiler, out of proportion to the benefit gained.

- Moving the unstable options to a separate `include!` file is marginally more convenient for the unstable-book-gen tool, but a big hassle for compiler contributors looking to read or modify the list of unstable options. It breaks normal file layout conventions, interferes with navigation, and interferes with IDE features, all without ever being truly necessary.

- The extra `syn`-based parser in unstable-book-gen is quite complicated, almost entirely undocumented, and seemingly buggy. That makes it extremely difficult to understand or modify, which in turn makes it effectively impossible to ever change the `options!` macro on the compiler side.

- The new tests in unstable-book-gen don't appear to be hooked up to run in CI.

- The compiler changes don't appear to have been approved by a T-compiler reviewer.

Before contemplating a revert, I tried to put together a fix-forward to resolve or mitigate some of these issues. But unstable-book-gen in its current state makes that impractical, so unfortunately I believe that the only way forward is to revert the original changes.

---

I do think the reverted functionality is potentially useful, and I'm not fundamentally opposed to a revised version of it landing in the future, if the relevant concerns are addressed.

But I feel strongly that the current version does not justify the real and troublesome maintenance burden that it imposes on compiler contributors.
2026-03-28 15:01:40 +11:00
Stuart Cook 624c3c010e Rollup merge of #154396 - xtqqczze:deps/tar, r=clubby789
chore(deps): update rust crate tar to v0.4.45

Fix [RUSTSEC-2026-0068](https://rustsec.org/advisories/RUSTSEC-2026-0068.html): tar-rs incorrectly ignores PAX size headers if header size is nonzero
Fix [RUSTSEC-2026-0067](https://rustsec.org/advisories/RUSTSEC-2026-0067.html): `unpack_in` can chmod arbitrary directories by following symlinks
2026-03-28 15:01:40 +11:00
Zalathar d470684a43 Revert "Unstable book options parser"
This reverts commit 6fd8466768, reversing
changes made to fda6d37bb8.
2026-03-28 14:18:26 +11:00
León Orell Valerian Liehr 59d86097fe Rollup merge of #154454 - ytmimi:rustfmt_issue_6513, r=jieyouxu
fix: [rustfmt] prevent panic when rewritng associated item delegations

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

rustfmt issue: https://github.com/rust-lang/rustfmt/issues/6513

Fixes a rustfmt bug for `#![feature(fn_delegation)]`
2026-03-27 15:11:58 +01:00
León Orell Valerian Liehr e8994eaa73 Rollup merge of #154428 - davidtwco:json-target-spec-synthetic-targets, r=jieyouxu
bootstrap: `-Zjson-target-spec` for synthetic targets

Fixes rust-lang/rust#154340

Synthetic targets for mir-opt tests build a standard library using a `.json` target, which now requires `-Zjson-target-spec`

r? @jieyouxu
2026-03-27 15:11:57 +01:00
León Orell Valerian Liehr 20f9361b76 Rollup merge of #154421 - chenyukang:yukang-fix-154395-rustdoc-json-emit-conflict, r=aDotInTheVoid
Rustdoc rejects html emits with json output

Fixes rust-lang/rust#154395
2026-03-27 15:11:57 +01:00
León Orell Valerian Liehr 9ee5459494 Rollup merge of #153528 - homersimpsons:chore/fix-LegacyKeyValueFormat-mips, r=marcoieni
Fix LegacyKeyValueFormat report from docker build: mips

Part of https://github.com/rust-lang/rust/pull/152305

r? @marcoieni
2026-03-27 15:11:55 +01:00
León Orell Valerian Liehr 9ba9194d1e Rollup merge of #154371 - zetanumbers:typeck_root_def_id_local, r=petrochenkov
Use LocalDefId for more tcx method calls

r? @petrochenkov

Might bring perf improvements
2026-03-27 15:11:54 +01:00
León Orell Valerian Liehr 6fd8466768 Rollup merge of #154070 - mehdiakiki:unstable-book-options-parser, r=clubby789
Unstable book options parser

Parses the `options!` macro in `compiler/rustc_session/src/options.rs` directly to extract the unstable (-Z) compiler flag names and descriptions to generate documentation for the unstable book.

I took notice from the previous attempt which ran `rustc -Zhelp` and parsed the output and used this approach that reads the source directly.

Used claude for the tedious char by char parsing parts but verified the code, I hope that's ok!
2026-03-27 15:11:53 +01:00
xtqqczze afe3ab6ac5 chore(deps): update rust crate tar to v0.4.45 2026-03-27 13:36:27 +00:00
Daria Sukhonina 62ec331a84 Use tcx.local_parent() more often 2026-03-27 15:36:29 +03:00
Daria Sukhonina 1b68d921a7 Add typeck_root_def_id_local 2026-03-27 15:36:28 +03:00
bors fda6d37bb8 Auto merge of #154455 - jhpratt:rollup-I3JcUWU, r=jhpratt
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#152457 (Pass -pg to linker when using -Zinstrument-mcount)
 - rust-lang/rust#154031 (Remove divergence check from check_expr_array)
 - rust-lang/rust#154418 (move many tests out of `ui/unsafe`)
 - rust-lang/rust#154441 (bootstrap: force a CI LLVM stamp bump)
 - rust-lang/rust#153675 (simd_add/sub/mul/neg: document overflow behavior)
 - rust-lang/rust#154430 (Create GPU target notification group)
2026-03-27 09:03:50 +00:00
bors e3691a5bd5 Auto merge of #154361 - nnethercote:rustc_hir_analysis-rustc_lint, r=davidtwco
Make `rustc_hir_analysis` not depend on `rustc_lint`.

`rustc_hir_analysis` depends on `rustc_lint` in just a single function: `emit_delayed_lint`, which is used by the
"emit_ast_lowering_delayed_lints" checking section within `rustc_hir_analysis::check_crate`.

This commit moves that function and section to out of `rustc_hir_analysis::check_crate`, into `rustc_interface`, eliminating the dependency. This seems reasonable because the delayed lint errors aren't really related to HIR analysis, they were in there just because HIR analysis is what follows AST lowering.

This means `rustc_hir_analysis` and `rustc_lint` can both start compiling as soon as `rustc_trait_selection` finishes. This also changes the error order in one test, which doesn't matter.

The commit also changes `emit_delayed_lint` to `emit_delayed_lints`, factoring out some code duplicated in rustdoc.

r? @davidtwco
2026-03-27 05:56:33 +00:00
Yacin Tmimi a53356ec89 fix: [rustfmt] prevent panic when rewritng associated item delegations
Fixes a rustfmt bug for `#![feature(fn_delegation)]`
2026-03-27 01:19:45 -04:00
yukang 7e95a22e1f rustdoc rejects html emits with json output 2026-03-27 08:59:51 +08:00
Manuel Drehwald fc5a7077ca bootstrap: force a CI LLVM stamp bump 2026-03-26 20:55:11 +01:00
David Wood 8fc058109b bootstrap: -Zjson-target-spec for synthetic targets 2026-03-26 14:59:15 +00:00
Jonathan Brouwer 37bc3bcaaa Rollup merge of #152757 - jakos-sec:add-msan-tsan, r=davidtwco
Add x86_64-unknown-linux-gnu{m,t}san target which enables {M,T}San by default

Analogous to the ASan target (https://github.com/rust-lang/rust/pull/149644), this adds targets for MSan and TSan.

As suggested, in order to distribute sanitizer instrumented standard libraries without introducing new rustc flags, this adds a new dedicated target. With the target, we can distribute the instrumented standard libraries through a separate rustup component.

> A tier 2 target must have value to people other than its maintainers. (It may still be a niche target, but it must not be exclusively useful for an inherently closed group.)

The target is useful to anyone who wants to use MSan/TSan with a stable compiler or the ease to not have to recompiled all standard libraries for full coverage.

> A tier 2 target must have a designated team of developers (the “target maintainers”) available to consult on target-specific build-breaking issues, or if necessary to develop target-specific language or library implementation details. This team must have at least 2 developers.
> * The target maintainers should not only fix target-specific issues, but should use any such issue as an opportunity to educate the Rust community about portability to their target, and enhance documentation of the target.

I pledge myself and the folks from the Exploit Mitigations Project Group (rcvalle@ & 1c3t3a@) as target maintainers to fix target-specific issues and educate the Rust community about their use.

> The target must not place undue burden on Rust developers not specifically concerned with that target. Rust developers are expected to not gratuitously break a tier 2 target, but are not expected to become experts in every tier 2 target, and are not expected to provide target-specific implementations for every tier 2 target.

Understood. The target should not have negative impact for anyone not using it.

> The target must provide documentation for the Rust community explaining how to build for the target using cross-compilation, and explaining how to run tests for the target. If at all possible, this documentation should show how to run Rust programs and tests for the target using emulation, to allow anyone to do so. If the target cannot be feasibly emulated, the documentation should explain how to obtain and work with physical hardware, cloud systems, or equivalent.

`src/doc/rustc/src/platform-support/x86_64-unknown-linux-gnu{m,t}san.md` should provide the necessary documentation on how to build the target or compile programs with it. In the way the target can be emulated it should not differ from the tier 1 target `x86_64-unknown-linux-gnu`.

> The target must document its baseline expectations for the features or versions of CPUs, operating systems, libraries, runtime environments, and similar.

The baseline expectation mirror `x86_64-unknown-linux-gnu`.

> If introducing a new tier 2 or higher target that is identical to an existing Rust target except for the baseline expectations for the features or versions of CPUs, operating systems, libraries, runtime environments, and similar, then the proposed target must document to the satisfaction of the approving teams why the specific difference in baseline expectations provides sufficient value to justify a separate target.
> * Note that in some cases, based on the usage of existing targets within the Rust community, Rust developers or a target’s maintainers may wish to modify the baseline expectations of a target, or split an existing target into multiple targets with different baseline expectations. A proposal to do so will be treated similarly to the analogous promotion, demotion, or removal of a target, according to this policy, with the same team approvals required.
>     * For instance, if an OS version has become obsolete and unsupported, a target for that OS may raise its baseline expectations for OS version (treated as though removing a target corresponding to the older versions), or a target for that OS may split out support for older OS versions into a lower-tier target (treated as though demoting a target corresponding to the older versions, and requiring justification for a new target at a lower tier for the older OS versions).

This has been outlined sufficiently. We should not enable MSan/TSan in the default target and are therefore creating a new tier 2 target to bridge the gap until `build-std` stabilized.

> Tier 2 targets must not leave any significant portions of core or the standard library unimplemented or stubbed out, unless they cannot possibly be supported on the target.
> * The right approach to handling a missing feature from a target may depend on whether the target seems likely to develop the feature in the future. In some cases, a target may be co-developed along with Rust support, and Rust may gain new features on the target as that target gains the capabilities to support those features.
> * As an exception, a target identical to an existing tier 1 target except for lower baseline expectations for the OS, CPU, or similar, may propose to qualify as tier 2 (but not higher) without support for std if the target will primarily be used in no_std applications, to reduce the support burden for the standard library. In this case, evaluation of the proposed target’s value will take this limitation into account.

All of std that is supported by `x86_64-unknown-linux-gnu` is also supported.

> The code generation backend for the target should not have deficiencies that invalidate Rust safety properties, as evaluated by the Rust compiler team. (This requirement does not apply to arbitrary security enhancements or mitigations provided by code generation backends, only to those properties needed to ensure safe Rust code cannot cause undefined behavior or other unsoundness.) If this requirement does not hold, the target must clearly and prominently document any such limitations as part of the target’s entry in the target tier list, and ideally also via a failing test in the testsuite. The Rust compiler team must be satisfied with the balance between these limitations and the difficulty of implementing the necessary features.
> * For example, if Rust relies on a specific code generation feature to ensure that safe code cannot overflow the stack, the code generation for the target should support that feature.
> * If the Rust compiler introduces new safety properties (such as via new capabilities of a compiler backend), the Rust compiler team will determine if they consider those new safety properties a best-effort improvement for specific targets, or a required property for all Rust targets. In the latter case, the compiler team may require the maintainers of existing targets to either implement and confirm support for the property or update the target tier list with documentation of the missing property.

The entire point is to have more security instead of less ;) The safety properties provided are already present in the compiler, just not enabled by default.

> If the target supports C code, and the target has an interoperable calling convention for C code, the Rust target must support that C calling convention for the platform via extern "C". The C calling convention does not need to be the default Rust calling convention for the target, however.

Understood.

> The target must build reliably in CI, for all components that Rust’s CI considers mandatory.

Understood and the reason for introducing the tier 2 target.

> The approving teams may additionally require that a subset of tests pass in CI, such as enough to build a functional “hello world” program, ./x.py test --no-run, or equivalent “smoke tests”. In particular, this requirement may apply if the target builds host tools, or if the tests in question provide substantial value via early detection of critical problems.

Understood.

> Building the target in CI must not take substantially longer than the current slowest target in CI, and should not substantially raise the maintenance burden of the CI infrastructure. This requirement is subjective, to be evaluated by the infrastructure team, and will take the community importance of the target into account.

Understood.

> Tier 2 targets should, if at all possible, support cross-compiling. Tier 2 targets should not require using the target as the host for builds, even if the target supports host tools.

Understood. No need to use this target as the host (no benefit of having MSan/TSan enabled for compiling).

> In addition to the legal requirements for all targets (specified in the tier 3 requirements), because a tier 2 target typically involves the Rust project building and supplying various compiled binaries, incorporating the target and redistributing any resulting compiled binaries (e.g. built libraries, host tools if any) must not impose any onerous license requirements on any members of the Rust project, including infrastructure team members and those operating CI systems. This is a subjective requirement, to be evaluated by the approving teams.
> * As an exception to this, if the target’s primary purpose is to build components for a Free and Open Source Software (FOSS) project licensed under “copyleft” terms (terms which require licensing other code under compatible FOSS terms), such as kernel modules or plugins, then the standard libraries for the target may potentially be subject to copyleft terms, as long as such terms are satisfied by Rust’s existing practices of providing full corresponding source code. Note that anything added to the Rust repository itself must still use Rust’s standard license terms.

Understood, no legal differences between this target and `x86_64-unknown-linux-gnu`.

> Tier 2 targets must not impose burden on the authors of pull requests, or other developers in the community, to ensure that tests pass for the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on tests failing for the target. Do not send automated messages or notifications (via any medium, including via @) to a PR author or others involved with a PR regarding the PR breaking tests on a tier 2 target, unless they have opted into such messages.
> * Backlinks such as those generated by the issue/PR tracker when linking to an issue or PR are not considered a violation of this policy, within reason. However, such messages (even on a separate repository) must not generate notifications to anyone involved with a PR who has not requested such notifications.

Understood.

> The target maintainers should regularly run the testsuite for the target, and should fix any test failures in a reasonably timely fashion.

Understood.

> All requirements for tier 3 apply.

Requirements for tier 3 are listed below.

> A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.)

I pledge to do my best maintaining it and we can also include the folks from the Exploit Mitigations Project Group (rcvalle@ & 1c3t3a@).

> Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge. Changing the name of a target can be highly disruptive, especially once the target reaches a higher tier, so getting the name right is important even for a tier 3 target.

We've chosen `x86_64-unknown-linux-gnu{m,t}san` as the name which was suggested on [#t-compiler/major changes > Create new Tier 2 targets with sanitizers… compiler-team#951 @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/233931-t-compiler.2Fmajor-changes/topic/Create.20new.20Tier.202.20targets.20with.20sanitizers.E2.80.A6.20compiler-team.23951/near/564482315). We've merged `x86_64-unknown-linux-gnuasan` and are now following up with the MSan and TSan targets

> Target names should not introduce undue confusion or ambiguity unless absolutely necessary to maintain ecosystem compatibility. For example, if the name of the target makes people extremely likely to form incorrect beliefs about what it targets, the name should be changed or augmented to disambiguate it.

There should be no confusion, it's clear that it's the original target with MSan/TSan enabled.

> If possible, use only letters, numbers, dashes and underscores for the name. Periods (.) are known to cause issues in Cargo.

Only letters, numbers and dashes used.

> Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users.

There are no unusual requirements to build or use it. It's the original `x86_64-unknown-linux-gnu` target with MSan/TSan enabled as a default sanitizer.

> The target must not introduce license incompatibilities.

There are no license implications.

> Anything added to the Rust repository must be under the standard Rust license (MIT OR Apache-2.0).

Given, by reusing the existing MSan/TSan code.

> The target must not cause the Rust tools or libraries built for any other host (even when supporting cross-compilation to the target) to depend on any new dependency less permissive than the Rust licensing policy. This applies whether the dependency is a Rust crate that would require adding new license exceptions (as specified by the tidy tool in the rust-lang/rust repository), or whether the dependency is a native library or binary. In other words, the introduction of the target must not cause a user installing or running a version of Rust or the Rust tools to be subject to any new license requirements.

There are no new dependencies/features required.

> Compiling, linking, and emitting functional binaries, libraries, or other code for the target (whether hosted on the target itself or cross-compiling from another target) must not depend on proprietary (non-FOSS) libraries. Host tools built for the target itself may depend on the ordinary runtime libraries supplied by the platform and commonly used by other applications built for the target, but those libraries must not be required for code generation for the target; cross-compilation to the target must not require such libraries at all. For instance, rustc built for the target may depend on a common proprietary C runtime library or console output library, but must not depend on a proprietary code generation library or code optimization library. Rust's license permits such combinations, but the Rust project has no interest in maintaining such combinations within the scope of Rust itself, even at tier 3.

It's using open source tools only.

> "onerous" here is an intentionally subjective term. At a minimum, "onerous" legal/licensing terms include but are not limited to: non-disclosure requirements, non-compete requirements, contributor license agreements (CLAs) or equivalent, "non-commercial"/"research-only"/etc terms, requirements conditional on the employer or employment of any particular Rust developers, revocable terms, any requirements that create liability for the Rust project or its developers or users, or any requirements that adversely affect the livelihood or prospects of the Rust project or its developers or users.

There are no such terms present.

> Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions.

Understood.

> This requirement does not prevent part or all of this policy from being cited in an explicit contract or work agreement (e.g. to implement or maintain support for a target). This requirement exists to ensure that a developer or team responsible for reviewing and approving a target does not face any legal threats or obligations that would prevent them from freely exercising their judgment in such approval, even if such judgment involves subjective matters or goes beyond the letter of these requirements.

Understood.

> Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions.

The goal is to have MSan/TSan instrumented standard library variants of the existing `x86_64-unknown-linux-gnu` target, so all should be present.

> The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running binaries, or running tests (even if they do not pass), the documentation must explain how to run such binaries or tests for the target, using emulation if possible or dedicated hardware if necessary.

I think the explanation in platform support doc is enough to make this aspect clear.

> Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via @) to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages.
Backlinks such as those generated by the issue/PR tracker when linking to an issue or PR are not considered a violation of this policy, within reason. However, such messages (even on a separate repository) must not generate notifications to anyone involved with a PR who has not requested such notifications.

Understood.

> Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target.

Understood.

> In particular, this may come up when working on closely related targets, such as variations of the same architecture with different features. Avoid introducing unconditional uses of features that another variation of the target may not have; use conditional compilation or runtime detection, as appropriate, to let each target run code supported by that target.

I don't believe this PR is affected by this.

> Tier 3 targets must be able to produce assembly using at least one of rustc's supported backends from any host target. (Having support in a fork of the backend is not sufficient, it must be upstream.)

The target should work on all rustc versions that correctly compile for `x86_64-unknown-linux-gnu`.
2026-03-26 15:20:09 +01:00
Jonathan Brouwer e06b9bbd5c Rollup merge of #154409 - scottmcm:change-try-tracking, r=TaKO8Ki
Update `try_blocks` to a new tracking issue number

New tracking issue https://github.com/rust-lang/rust/issues/154391
Closes rust-lang/rust#31436
2026-03-26 08:16:53 +01:00
Scott McMurray 4a31988c75 Update try_blocks to a new tracking issue number 2026-03-25 23:04:10 -07:00
Nicholas Nethercote a733192980 Make rustc_hir_analysis not depend on rustc_lint.
`rustc_hir_analysis` depends on `rustc_lint` in just a single function:
`emit_delayed_lint`, which is used by the
"emit_ast_lowering_delayed_lints" checking section within
`rustc_hir_analysis::check_crate`.

This commit moves that function and section to out of
`rustc_hir_analysis::check_crate`, into `rustc_interface`, eliminating
the dependency. This seems reasonable because the delayed lint errors
aren't really related to HIR analysis. They were in there just because
HIR analysis follows AST lowering.

This means `rustc_hir_analysis` and `rustc_lint` can both start
compiling as soon as `rustc_trait_selection` finishes. This also changes
the error order in one test, which doesn't matter.

The commit also changes `emit_delayed_lint` to `emit_delayed_lints`,
factoring out some code duplicated in rustdoc.
2026-03-26 14:31:43 +11:00
bors 80d0e4be6f Auto merge of #154384 - JonathanBrouwer:rollup-Wou9g2B, r=JonathanBrouwer
Rollup of 22 pull requests

Successful merges:

 - rust-lang/rust#153049 (Add `-Zsanitize=kernel-hwaddress`)
 - rust-lang/rust#153702 (Add macro matcher for `guard` fragment specifier)
 - rust-lang/rust#154200 (debuginfo: emit DW_TAG_call_site entries)
 - rust-lang/rust#154263 (interpret: when passing an argument fails, point at that argument)
 - rust-lang/rust#154269 (miri recursive validation: only check one layer deep)
 - rust-lang/rust#154313 (Init `self_decl` with a correct visibility)
 - rust-lang/rust#154344 (Update LLVM to 22.1.2)
 - rust-lang/rust#154348 (re-enable enzyme/autodiff builds on dist-aarch64-apple)
 - rust-lang/rust#154351 (Overhaul `Erasable` impls)
 - rust-lang/rust#154363 (delegation: fix zero-args nested delegation ICE)
 - rust-lang/rust#154364 (delegation: don't propagate synthetic params, remove lifetime hacks)
 - rust-lang/rust#151148 (Add functions to `GrowableBitSet`)
 - rust-lang/rust#154090 (Move tests in the statics category)
 - rust-lang/rust#154112 (some `tests/ui/macros` cleanup)
 - rust-lang/rust#154131 (begin `tests/ui/structs-enums` cleanup)
 - rust-lang/rust#154216 (unstably mark `NonNull::with_exposed_provenance` as const)
 - rust-lang/rust#154230 (Moved and rename issue-50411 to tests/ui/mir/inliner-double-elaborate)
 - rust-lang/rust#154233 (Move ui/issues tests to relevant subdirectories)
 - rust-lang/rust#154288 (Fix typo in doc comment for `char::to_titlecase`)
 - rust-lang/rust#154355 (delegation: add const type ICE test)
 - rust-lang/rust#154358 (install-template.sh: Optimize by using Bourne shell builtins.)
 - rust-lang/rust#154360 (fromrangeiter-overflow-checks: accept optional `signext` for argument)
2026-03-25 20:01:44 +00:00
Jonathan Brouwer 796d52f3e4 Rollup merge of #154358 - he32:installer-perf-fix-2, r=jieyouxu
install-template.sh: Optimize by using Bourne shell builtins.

This replaces forking separate processes and using "cut" with Bourne shell builtin operations for "remove largest suffix pattern" and "remove smallest prefix pattern" operations.

This is the follow-up of https://github.com/rust-lang/rust/pull/145809
2026-03-25 19:53:01 +01:00
Jonathan Brouwer 908fae7efb Rollup merge of #154348 - ZuseZ4:autodiff-apple, r=Kobzol
re-enable enzyme/autodiff builds on dist-aarch64-apple

Now that https://github.com/rust-lang/rust/pull/151063/ has landed, re-enable enzyme.

cc @sgasho

r? @kobzol
2026-03-25 19:52:54 +01:00
Jonathan Brouwer d0fcb41318 Rollup merge of #154344 - dianqk:update-llvm, r=nikic
Update LLVM to 22.1.2

Fixes https://github.com/rust-lang/rust/issues/154101.
2026-03-25 19:52:53 +01:00
Jonathan Brouwer b5e4b4ca79 Rollup merge of #154269 - RalfJung:miri-recursive-shallow, r=saethlin
miri recursive validation: only check one layer deep

As has been proposed in https://github.com/rust-lang/unsafe-code-guidelines/issues/414, let's see what happens if we make recursive checking in Miri shallow: we treat whatever is behind a reference as if it was inside `MaybeDangling`, which means nested references do not have to be dereferenceable.

This changes the meaning of the original flag -- I don't think it is worth supporting multiple variants of recursive checking (it'd require a bunch of new plumbing), and this seems to be the strictest variant that still has any traction in the discussion.
2026-03-25 19:52:52 +01:00
Jonathan Brouwer 27f9b7ca59 Rollup merge of #154263 - RalfJung:interpret-arg-passing-spans, r=oli-obk
interpret: when passing an argument fails, point at that argument

For a long time now, we did some contortions so that when something goes wrong while initializing the arguments for a function, we point at the call site rather than the callee. Historically, this had to be done because the "current location" in the callee pointed at the first instruction, which would obviously be nonsense. A while ago we gained the ability in the interpreter for the "current location" to be just a span that we point at for errors, but we never reevaluated the decision for how spans are handled during function calls. (We did use this "just a span" location for [errors during the initial stack frame setup](https://github.com/rust-lang/rust/commit/d21e0118d0eefc8b0073fa47fa16699d37047abf), but not for argument initialization.)

There's no always-great choice for pointing at the caller vs the callee: when they disagree about the type of an argument, either side could be wrong. If We do *two* typed copies in that case, one at the caller type and one at the callee type. Arguably we should point at the one that goes wrong, but we don't have a good way to expose that.

What ultimately pushed me over the edge towards pointing at the callee are two points:
- This provides strictly more information. if we point at the callee, the caller is available in the stacktrace. But if we point at the caller, then it might be impossible to figure out the actual callee if a function pointer or dyn call is involved.
- As part of resolving some long-standing questions around retags I am moving retagging to become part of validation, which means the retag and protector initialization of function arguments will happen during argument initialization. These currently point at the argument inside the callee, which I think is strictly preferable for these errors.

The diff will be much smaller with whitespace changes hidden.
2026-03-25 19:52:51 +01:00
Jonathan Brouwer 6e3c17424d Rollup merge of #153702 - SpriteOvO:guard-matcher, r=davidtwco
Add macro matcher for `guard` fragment specifier

Tracking issue #153104

This PR implements a new `guard` macro matcher to match `if-let` guards (specifically [`MatchArmGuard`](https://github.com/rust-lang/reference/blob/50a1075e879be75aeec436252c84eef0fad489f4/src/expressions/match-expr.md#match-guards)). In the upcoming PR, we can use this new matcher in the `matches!` and `assert_matches!` macros to support their use with `if-let` guards. (see #152313)

The original `Expr` used to represent a guard has been wrapped in a new `Guard` type, allowing us to carry the span information of the leading `if` keyword. However, it might be even better to include the `if` keyword in the `Guard` type as well? I've left a FIXME comment in the code.
2026-03-25 19:52:50 +01:00
Jonathan Brouwer 0cd8de3843 Rollup merge of #153049 - Darksonn:kasan-sw-tags, r=fmease
Add `-Zsanitize=kernel-hwaddress`

The Linux kernel has a config option called `CONFIG_KASAN_SW_TAGS`  that enables `-fsanitize=kernel-hwaddress`. This is not supported by Rust.

One slightly awkward detail is that `#[sanitize(address = "off")]` applies to both `-Zsanitize=address` and `-Zsanitize=kernel-address`. Probably it was done this way because both are the same LLVM pass. I replicated this logic here for hwaddress, but it might be undesirable.

Note that `#[sanitize(kernel_hwaddress = "off")]` could be supported as an annotation on statics, but since it's also missing for `#[sanitize(hwaddress = "off")]`, I did not add it.

MCP: https://github.com/rust-lang/compiler-team/issues/975
Tracking issue: https://github.com/rust-lang/rust/issues/154171

cc @rcvalle @maurer @ojeda
2026-03-25 19:52:49 +01:00
Manuel Drehwald 988633d72c re-enable enzyme/autodiff builds on dist-aarch64-apple 2026-03-25 12:37:03 +01:00
bjorn3 d7f7241eb2 Update tidy allowed deps list 2026-03-25 11:48:54 +01:00
Havard Eidnes 86aac98cfc install-template.sh: Optimize by using Bourne shell builtins.
This replaces forking separate processes and using "cut" with Bourne
shell builtin operations for "remove largest suffix pattern" and
"remove smallest prefix pattern" operations.
2026-03-25 07:30:12 +00:00
randomicon00 75bd926afd address PR review feedback for unstable-book-gen 2026-03-24 21:49:44 -04:00
dianqk 283d705b31 Update LLVM to 22.1.2 2026-03-25 07:32:01 +08:00
bors 8a703520e8 Auto merge of #154339 - JonathanBrouwer:rollup-FPeeGxJ, r=JonathanBrouwer
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#154311 ([libcore] Disable `doc(auto_cfg)` for integers trait impls)
 - rust-lang/rust#154331 (allow `incomplete_features` in all ui tests)
 - rust-lang/rust#154336 (Remove more BuiltinLintDiag variants - part 3)
2026-03-24 22:00:08 +00:00
cyrgani 97e84d5a56 allow incomplete_features in all ui tests 2026-03-24 20:00:26 +00:00
bors 362211dc29 Auto merge of #154326 - JonathanBrouwer:rollup-MflIdQW, r=JonathanBrouwer
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#152710 (Unalign `PackedFingerprint` on all hosts, not just x86 and x86-64)
 - rust-lang/rust#153874 (constify const Fn*: Destruct)
 - rust-lang/rust#154097 (improve validation error messages: show surrounding type)
 - rust-lang/rust#154277 (use `minicore` more in testing inline assembly)
 - rust-lang/rust#154293 (Use verbose span suggestion for type const)
2026-03-24 18:37:19 +00:00
Alice Ryhl 4d86840bf1 Document kernel-hwaddress in Unstable Book 2026-03-24 17:46:20 +00:00
Jonathan Brouwer ab6401749a Rollup merge of #154097 - RalfJung:validity-error, r=oli-obk
improve validation error messages: show surrounding type

Also, for dyn-downcast show the type we're downcasting to.

r? @oli-obk
2026-03-24 18:14:15 +01:00
Jonathan Brouwer eb7fa12d76 Rollup merge of #154284 - zamazan4ik:patch-1, r=JohnTitor
doc: linker-plugin-based LTO: update list of good combinations

This PR is similar to https://github.com/rust-lang/rust/pull/146827 . I just ran the Python script as was [recommended](https://github.com/rust-lang/rust/pull/146827#pullrequestreview-3255349459) in this comment. Also updated the LOWER_BOUND in the script to skip a bit redundant work in the Python script.

@nnethercote pinging you as a reviewer here since the last time you did it too ;)
2026-03-24 16:22:50 +01:00
Jonathan Brouwer a1c32ca566 Rollup merge of #154276 - cyrgani:incomplete-mcp-2, r=fmease
allow `incomplete_features` in more tests

This PR allows the `incomplete_features` lint for the `traits` and `const-generics` directories. `specialization` will come in a followup PR.

Followup to rust-lang/rust#154174.
Part of https://github.com/rust-lang/rust/issues/154168.
2026-03-24 16:22:50 +01:00
Jonathan Brouwer 898b62f590 Rollup merge of #154094 - folkertdev:aarch64-arm-load-store, r=sayantn
add neon load/store assembly test

I'm adding this test because it was requested for the beta backport of https://github.com/rust-lang/rust/issues/153336. We'd like to test this with Miri, but currently there is no load/store pair that roundtrips because one or the other still uses the platform-specific intrinsics.

r? sayantn

I believe test-various runs some arm and android tests?

@bors try job=test-various
2026-03-24 16:22:49 +01:00
bors cde9cf08d7 Auto merge of #151063 - sgasho:aarch64-dist-enzyme, r=ZuseZ4
Link LLVM dynamically on aarch64-apple-darwin



Follow-up to rust-lang/rust#152768.

* Link LLVM dynamically on MacOS
* Fix a macOS LLVM dylib name mismatch
2026-03-24 08:05:38 +00:00
Ralf Jung 5f68044357 miri recursive checking: only check one layer deep 2026-03-24 07:59:37 +01:00