Commit graph

315963 commits

Author SHA1 Message Date
Guillaume Gomez
fcbb046ced Add a marker to tell users that there are hidden (deprecated) items in the search results 2026-01-24 12:19:14 +01:00
bors
88ad3d44ca Auto merge of #151436 - jhpratt:rollup-Rp5KtGe, r=jhpratt
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#150436 (`c_variadic`: impl `va_copy` and `va_end` as Rust intrinsics)
 - rust-lang/rust#151340 (Port `#[patchable_function_entry]` to attr parser)
 - rust-lang/rust#151351 (Deduplicate diagnostics for const trait supertraits)
 - rust-lang/rust#151424 (missing colon after the compile-flags directive)
 - rust-lang/rust#151428 (Port variance attrs to attr parser.)
 - rust-lang/rust#151429 (s390x: Support aligned stack datalayout)

Failed merges:

 - rust-lang/rust#151343 (Port some crate level attrs to the attribute parser)

r? @ghost
2026-01-21 03:21:23 +00:00
Jacob Pratt
db9ff0d44f
Rollup merge of #151429 - s390x, r=durin42
s390x: Support aligned stack datalayout

LLVM 23 will mark the stack as aligned for more efficient code:

https://github.com/llvm/llvm-project/pull/176041

r? durin42

@rustbot label llvm-main
2026-01-20 19:46:32 -05:00
Jacob Pratt
0b8a935e7d
Rollup merge of #151428 - attrs3, r=JonathanBrouwer
Port variance attrs to attr parser.

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

Ports rustc_variance and rustc_variance_of_opaques to be parsed attributes.

Info: https://rustc-dev-guide.rust-lang.org/variance.html
2026-01-20 19:46:31 -05:00
Jacob Pratt
7e10816322
Rollup merge of #151424 - fix-missing-colon-in-test, r=Kivooeo
missing colon after the compile-flags directive

This is a trivial issue as the title suggests. All tests in the `ui` test suite have a colon after the `compile-flags` directive except for this one.
2026-01-20 19:46:31 -05:00
Jacob Pratt
69fa72e21e
Rollup merge of #151351 - yukang-fix-150052-deduplicate-const-trait-supertraits, r=Kivooeo
Deduplicate diagnostics for const trait supertraits

Fixes rust-lang/rust#150052
2026-01-20 19:46:31 -05:00
Jacob Pratt
79be7a0e75
Rollup merge of #151340 - port_patchable_function_entry, r=JonathanBrouwer
Port `#[patchable_function_entry]` to attr parser

This is the last codegen attr (see rust-lang/rust#151335 and rust-lang/rust#151336)!

Tracking issue: rust-lang/rust#131229

currently this PR is rebased on rust-lang/rust#151336 to make CI pass for the last commit

to see the actual changes in this PR you can look [here](3e731f7e84..55111fb468)
2026-01-20 19:46:30 -05:00
Jacob Pratt
43d2006c25
Rollup merge of #150436 - va-list-copy, r=workingjubilee,RalfJung
`c_variadic`: impl `va_copy` and `va_end` as Rust intrinsics

tracking issue: https://github.com/rust-lang/rust/issues/44930

Implement `va_copy` as (the rust equivalent of) `memcpy`, which is the behavior of all current LLVM targets. By providing our own implementation, we can guarantee its behavior. These guarantees are important for implementing c-variadics in e.g. const-eval.

Discussed in [#t-compiler/const-eval > c-variadics in const-eval](https://rust-lang.zulipchat.com/#narrow/channel/146212-t-compiler.2Fconst-eval/topic/c-variadics.20in.20const-eval/with/565509704).

I've also updated the comment for `Drop` a bit. The background here is that the C standard requires that `va_end` is used in the same function (and really, in the same scope) as the corresponding `va_start` or `va_copy`. That is because historically `va_start` would start a scope, which `va_end` would then close. e.g.

https://softwarepreservation.computerhistory.org/c_plus_plus/cfront/release_3.0.3/source/incl-master/proto-headers/stdarg.sol

```c
#define         va_start(ap, parmN)     {\
        va_buf  _va;\
        _vastart(ap = (va_list)_va, (char *)&parmN + sizeof parmN)
#define         va_end(ap)      }
#define         va_arg(ap, mode)        *((mode *)_vaarg(ap, sizeof (mode)))
```

The C standard still has to consider such implementations, but for Rust they are irrelevant. Hence we can use `Clone` for `va_copy` and `Drop` for `va_end`.
2026-01-20 19:46:29 -05:00
bors
d276646872 Auto merge of #151382 - JonathanBrouwer:attr-perf, r=jdonszelmann
Only run finalizers of accepted attributes

Locally this had insanely good perf, but lets see what reality thinks about this
r? @jdonszelmann 

Attribute parsing consists of two stages:

- All attribute are "accepted" by one or more parsers, which means the unparsed attribute is parsed, information about it is stored in the attr parser struct
- After all attributes are parsed, we "finalize" all parsers, producing a single parsed attribute representation from the parser struct.

This two-stage process exist so multiple attributes can get merged into one parser representation. For example if you have two repr attributes `#[repr(C)]` `#[repr(packed)]` it will only produce one parsed `Repr` attribue.

The dumb thing we did was we would "finalize" all parsers, even the ones that never accepted an attribute. This PR only calls finalize on the parsers that accepted at least one attribute.
2026-01-21 00:01:49 +00:00
bors
af6695c114 Auto merge of #151427 - GuillaumeGomez:rollup-HAeLPDZ, r=GuillaumeGomez
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#151216 ([rustdoc] Make popover menus content scrollable on mobile devices)
 - rust-lang/rust#151373 (Fix an ICE on transmute goals with placeholders in `param_env`)
 - rust-lang/rust#151399 (Generate error delegation when delegation is not resolved)
 - rust-lang/rust#151406 (Use version 1.93.0 in `RELEASES.md` instead of 1.93)
 - rust-lang/rust#151410 (Fixes for LLVM 22 compatibility)
 - rust-lang/rust#151415 (chore: Remove redundant conversion)
 - rust-lang/rust#151418 (Avoid pulling in unicode when calling io::Error::kind)

r? @ghost
2026-01-20 20:44:58 +00:00
Matthew Maurer
39296ff8f8 s390x: Support aligned stack datalayout
LLVM 23 will mark the stack as aligned for more efficient code:

https://github.com/llvm/llvm-project/pull/176041
2026-01-20 20:21:11 +00:00
Oscar Bray
005fcea374 Port variance attrs to attr parser. 2026-01-20 19:32:24 +00:00
Guillaume Gomez
3682ed780e
Rollup merge of #151418 - windows-error-kind-size, r=nagisa
Avoid pulling in unicode when calling io::Error::kind

Reduces binary size by ~1KB.
2026-01-20 19:50:11 +01:00
Guillaume Gomez
62090bb21d
Rollup merge of #151415 - remove-redundant-from, r=nagisa
chore: Remove redundant conversion

The type of `code` is `u32`, so this `u32::from` is not necessary.
2026-01-20 19:50:11 +01:00
Guillaume Gomez
87f83fa0d2
Rollup merge of #151410 - llvm-22-fixes, r=cuviper
Fixes for LLVM 22 compatibility

This includes three fixes for LLVM 22 compatibility:

 * Update the AMDGPU data layout.
 * Update AVX512 target feature handling. `evex512` is no longer used and `avx10.[12]-512` are now just `avx10.[12]`, matching the Rust feature name.
 * Strip address space casts when emitting lifetime intrinsics. These are now required to directly work on the alloca.

r? @cuviper
2026-01-20 19:50:10 +01:00
Guillaume Gomez
727f5d0f9b
Rollup merge of #151406 - patch-2, r=cuviper
Use version 1.93.0 in `RELEASES.md` instead of 1.93
2026-01-20 19:50:09 +01:00
Guillaume Gomez
bfc2fe9080
Rollup merge of #151399 - unresolved-delegation-ice, r=petrochenkov
Generate error delegation when delegation is not resolved

This PR is a part of the delegation feature rust-lang/rust#118212 and fixes rust-lang/rust#151356.

r? @petrochenkov
2026-01-20 19:50:09 +01:00
Guillaume Gomez
c05083582c
Rollup merge of #151373 - issue-151300, r=lcnr
Fix an ICE on transmute goals with placeholders in `param_env`

Fixes rust-lang/rust#151300

The next solver short-circuits `consider_builtin_transmute_candidate` when the goal contains non-region placeholders, since `rustc_transmute` does not support type parameters.
However, this check should likely be refined to apply only to the predicate itself: excess bounds with type params in the param env can cause the goal to be rejected even when its predicate trivially holds.

r? types
2026-01-20 19:50:08 +01:00
Guillaume Gomez
e965bcaf8b
Rollup merge of #151216 - scrollable-popover-content, r=lolbinarycat
[rustdoc] Make popover menus content scrollable on mobile devices

Fixes rust-lang/rust#151209.

This is what it looks like:

<img width="468" height="601" alt="image" src="https://github.com/user-attachments/assets/39dcbfea-ca31-4875-947f-155b58ffa4bd" />

The only difference with the current display:

<img width="468" height="601" alt="image" src="https://github.com/user-attachments/assets/b49c6100-3566-4f79-8343-1bf4fe32da78" />

is that we now see the bottom border (and that we can scroll the content too of course).

I applied this change to both the settings and helps popover menus.

r? @lolbinarycat
2026-01-20 19:50:08 +01:00
Meng Xu
9304071904 missing colon after the compile-flags directive 2026-01-20 13:05:41 -05:00
Folkert de Vries
922057cfa6
c-variadic: make VaList::drop call the rust va_end 2026-01-20 18:38:50 +01:00
Folkert de Vries
dd9241d150
c_variadic: use Clone instead of LLVM va_copy 2026-01-20 18:38:50 +01:00
Leonard Hecker
711ea73875
Avoid pulling in unicode when calling io::Error::kind 2026-01-20 18:00:56 +01:00
Shun Sakai
603955f542 chore: Remove redundant conversion 2026-01-21 00:51:19 +09:00
Shoyu Vanilla
328893e1a6 Fix an ICE on transmute goals with placeholders in param_env 2026-01-21 00:40:51 +09:00
Guillaume Gomez
d5bacddca9 Update GUI test to new number of settings and add note about it 2026-01-20 15:58:34 +01:00
bors
5c49c4f7c8 Auto merge of #151409 - GuillaumeGomez:rollup-bDqwVwM, r=GuillaumeGomez
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#147611 (Stabilize `-Zremap-path-scope`)
 - rust-lang/rust#149058 (FCW Lint when using an ambiguously glob imported trait)
 - rust-lang/rust#149644 (Create x86_64-unknown-linux-gnuasan target which enables ASAN by default)
 - rust-lang/rust#150524 (Test that -Zbuild-std=core works on a variety of profiles)
 - rust-lang/rust#151394 (Fix typos: 'occured' -> 'occurred' and 'non_existant' -> 'non_existent')
 - rust-lang/rust#151396 (`rustc_queries!`: Don't push the `(cache)` modifier twice)

r? @ghost
2026-01-20 14:42:53 +00:00
Nikita Popov
08da3685ed Don't use evex512 with LLVM 22
As Intel has walked back on the existence of AVX 10.1-256, LLVM
no longer uses evex512 and avx-10.n-512 are now avx-10.n instead,
so we can skip all the special handling on LLVM 22.
2026-01-20 14:47:09 +01:00
Nikita Popov
0be66603ac Avoid passing addrspacecast to lifetime intrinsics
Since LLVM 22 the alloca must be passed directly. Do this by
stripping the addrspacecast if it exists.
2026-01-20 14:47:04 +01:00
Nikita Popov
bf3ac98d69 Update amdgpu data layout
This changed in:
853760bca6
2026-01-20 14:46:58 +01:00
Guillaume Gomez
83ce00e35e
Rollup merge of #151396 - cache-cache, r=lqd
`rustc_queries!`: Don't push the `(cache)` modifier twice

Due to some kind of merge/rebase mishap in https://github.com/rust-lang/rust/pull/101307 and https://github.com/rust-lang/rust/pull/101173, we ended up with two copies of this query modifier.

Thankfully the redundant copy was harmless.

- https://github.com/rust-lang/rust/pull/101307
- https://github.com/rust-lang/rust/pull/101173
2026-01-20 14:36:32 +01:00
Guillaume Gomez
1ae74b3e00
Rollup merge of #151394 - fix-typos-occured-occurred, r=GuillaumeGomez
Fix typos: 'occured' -> 'occurred' and 'non_existant' -> 'non_existent'
2026-01-20 14:36:32 +01:00
Guillaume Gomez
79c02e25a0
Rollup merge of #150524 - test-build-std, r=jieyouxu,kobzol
Test that -Zbuild-std=core works on a variety of profiles

See [#t-infra > Non-blocking testing for -Zbuild-std?](https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/Non-blocking.20testing.20for.20-Zbuild-std.3F/with/565837190) for some background.

This is an incredibly CPU-hungry run-make-cargo test, but at least on my desktop the entire suite only takes a minute.
2026-01-20 14:36:31 +01:00
Guillaume Gomez
91ac25459b
Rollup merge of #149644 - create-asan-target, r=mati865
Create x86_64-unknown-linux-gnuasan target which enables ASAN by default

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 ASAN 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-gnuasan.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 enabled ASAN 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 ASAN 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-gnuasan` 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).

> 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 ASAN 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 ASAN 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 ASAN 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 ASAN 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-01-20 14:36:31 +01:00
Guillaume Gomez
b5fa7495fe
Rollup merge of #149058 - amb-trait-lint, r=petrochenkov
FCW Lint when using an ambiguously glob imported trait

Related to rust-lang/rust#147992.

Report a lint when using an ambiguously glob import trait, this is a FCW because this should not be allowed.

r? @petrochenkov
2026-01-20 14:36:30 +01:00
Guillaume Gomez
1832bdfe64
Rollup merge of #147611 - stablize-remap-path-scope, r=davidtwco
Stabilize `-Zremap-path-scope`

# Stabilization report of `--remap-path-scope`

## Summary

RFC 3127 trim-paths aims to improve the current status of sanitizing paths emitted by the compiler via the `--remap-path-prefix=FROM=TO` command line flag, by offering a profile setting named `trim-paths` in Cargo to sanitize absolute paths introduced during compilation that may be embedded in the compiled binary executable or library.

As part of that RFC the compiler was asked to add the `--remap-path-scope` command-line flag to control the scoping of how paths get remapped in the resulting binary.

Tracking:

- https://github.com/rust-lang/rust/issues/111540

### What is stabilized

The rustc `--remap-path-scope` flag is being stabilized by this PR. It defines which scopes of paths should be remapped by `--remap-path-prefix`.

This flag accepts a comma-separated list of values and may be specified multiple times, in which case the scopes are aggregated together.

The valid scopes are:

- `macro` - apply remappings to the expansion of `std::file!()` macro. This is where paths in embedded panic messages come from
- `diagnostics` - apply remappings to printed compiler diagnostics
- `debuginfo` - apply remappings to debug informations
- `coverage` - apply remappings to coverage informations
- `object` - apply remappings to all paths in compiled executables or libraries, but not elsewhere. Currently an alias for `macro,coverage,debuginfo`.
- `all` (default) - an alias for all of the above, also equivalent to supplying only `--remap-path-prefix` without `--remap-path-scope`.

#### Example

```sh
# With `object` scope only the build outputs will be remapped, the diagnostics won't be remapped.
rustc --remap-path-prefix=$(PWD)=/remapped --remap-path-scope=object main.rs
```

### What isn't stabilized

None of the Cargo facility is being stabilized in this stabilization PR, only the `--remap-path-scope` flag in `rustc` is being stabilized.

## Design

### RFC history

- [RFC3127 - trim-paths](https://rust-lang.github.io/rfcs/3127-trim-paths.html)

### Answers to unresolved questions

> What questions were left unresolved by the RFC? How have they been answered? Link to any relevant lang decisions.

There are no unresolved questions regarding `--remap-path-scope`.

(The tracking issue list a bunch of unresolved questions but they are for `--remap-path-prefix` or the bigger picture `trim-paths` in Cargo and are not related the functionality provided by `--remap-path-scope`.)

### Post-RFC changes

The RFC described more scopes, in particularly regarding split debuginfo. Those scopes where removed after analysis by `michaelwoerister` of all the possible combinations in https://github.com/rust-lang/rust/issues/111540#issuecomment-1994010274.

### Nightly extensions

There are no nightly extensions.

### Doors closed

We are committing to having to having a flag that control which paths are being remapped based on a "scope".

## Feedback

### Call for testing

> Has a "call for testing" been done? If so, what feedback was received?

No call for testing has been done per se but feedback has been received on both the rust-lang/rust and rust-lang/cargo tracking issue.

The feedback was mainly related to deficiencies in *our best-effort* `--remap-path-prefix` implementation, in particular regarding linkers added paths, which does not change anything for `--remap-path-scope`.

### Nightly use

> Do any known nightly users use this feature? Counting instances of `#![feature(FEATURE_NAME)]` on GitHub with grep might be informative.

Except for Cargo unstable `trim-paths` there doesn't appear any committed use [on GitHub](https://github.com/search?q=%22--remap-path-scope%22+NOT+path%3A%2F%5Esrc%5C%2Fcargo%5C%2Fcore%5C%2Fcompiler%5C%2F%2F+NOT+path%3A%2F%5Etext%5C%2F%2F+NOT+path%3A%2F%5Erust%5C%2Fsrc%5C%2Fdoc%5C%2Funstable-book%5C%2Fsrc%5C%2Fcompiler-flags%5C%2F%2F+NOT+path%3A%2F%5Esrc%5C%2Fdoc%5C%2Funstable-book%5C%2Fsrc%5C%2Fcompiler-flags%5C%2F%2F+NOT+path%3A%2F%5Ecollector%5C%2Fcompile-benchmarks%5C%2Fcargo-0%5C.87%5C.1%5C%2Fsrc%5C%2Fcargo%5C%2Fcore%5C%2Fcompiler%5C%2F%2F&type=code).

## Implementation

### Major parts

- b3f8586fb1/compiler/rustc_session/src/config.rs (L1373-L1384)
- b3f8586fb1/compiler/rustc_session/src/session.rs (L1526)
- b3f8586fb1/compiler/rustc_span/src/lib.rs (L352-L372)

### Coverage

- [`tests/run-make/split-debuginfo/rmake.rs`](9725c4baac/tests/run-make/split-debuginfo/rmake.rs (L7))
- [`tests/ui/errors/remap-path-prefix.rs`](9725c4baac/tests/ui/errors/remap-path-prefix.rs (L4))
- [`tests/ui/errors/remap-path-prefix-macro.rs`](9725c4baac/tests/ui/errors/remap-path-prefix-macro.rs (L1-L4))
- [`tests/run-make/remap-path-prefix-dwarf/rmake.rs
`](9725c4baac/tests/run-make/remap-path-prefix-dwarf/rmake.rs)
- [`tests/run-make/remap-path-prefix/rmake.rs`](9725c4baac/tests/run-make/remap-path-prefix/rmake.rs)
- [`tests/ui/errors/remap-path-prefix-diagnostics.rs`](9725c4baac/tests/ui/errors/remap-path-prefix-diagnostics.rs)

### Outstanding bugs

> What outstanding bugs involve this feature? List them. Should any block the stabilization? Discuss why or why not.

There are no outstanding bugs regarding `--remap-path-scope`.

### Outstanding FIXMEs

> What FIXMEs are still in the code for that feature and why is it OK to leave them there?

There are no FIXME regarding `--remap-path-scope` in it-self.

### Tool changes

> What changes must be made to our other tools to support this feature. Has this work been done? Link to any relevant PRs and issues.

- rustdoc (both JSON, HTML and doctest)
  - `rustdoc` has support for `--remap-path-prefix`, it should probably also get support for `--remap-path-scope`, although rustdoc maybe want to adapt the scopes for it's use (replace `debuginfo` with `documentation` for example).

## History

> List issues and PRs that are important for understanding how we got here.

- https://github.com/rust-lang/rust/pull/115214
- https://github.com/rust-lang/rust/pull/122450
- https://github.com/rust-lang/rust/pull/139550
- https://github.com/rust-lang/rust/pull/140716

## Acknowledgments

> Summarize contributors to the feature by name for recognition and so that those people are notified about the stabilization. Does anyone who worked on this *not* think it should be stabilized right now? We'd like to hear about that if so.

- @cbeuw
- @michaelwoerister
- @weihanglo
- @Urgau

@rustbot labels +T-compiler +needs-fcp +F-trim-paths
r? @davidtwco
2026-01-20 14:36:30 +01:00
Guillaume Gomez
76ea822db2 Add rustdoc GUI regression test for #151209 2026-01-20 14:35:38 +01:00
Guillaume Gomez
c14d78f4ae Make popover menus content scrollable on mobile devices 2026-01-20 14:35:38 +01:00
LorrensP-2158466
3369a17e51 Implements a FCW lint to detect uses of ambiguously glob imported traits. 2026-01-20 13:34:01 +01:00
Asger Hautop Drewsen
6b8432bee3
Use version 1.93.0 in RELEASES.md instead of 1.93 2026-01-20 12:57:16 +01:00
Edvin Bryntesson
a0b3ee2f76
only process parsed attrs for codegen check 2026-01-20 11:46:25 +01:00
Edvin Bryntesson
b65e1fdcb8
Port #[patchable_function_entry] to attr parser 2026-01-20 11:46:05 +01:00
Jakob Koschel
c222a00e79 Create x86_64-unknown-linux-gnuasan target which enables ASAN by default
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.
2026-01-20 09:21:53 +00:00
bors
fffc4fcf96 Auto merge of #151395 - Zalathar:rollup-8gANGZS, r=Zalathar
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#149587 (coverage: Sort the expansion tree to help choose a single BCB for child expansions)
 - rust-lang/rust#150071 (Add dist step for Enzyme)
 - rust-lang/rust#150288 (Add scalar support for offload)
 - rust-lang/rust#151091 (Add new "hide deprecated items" setting in rustdoc)
 - rust-lang/rust#151255 (rustdoc: Fix ICE when deprecated note is not resolved on the correct `DefId`)
 - rust-lang/rust#151375 (Fix terminal  width dependent tests)
 - rust-lang/rust#151384 (add basic `TokenStream` api tests)
 - rust-lang/rust#151391 (rustc-dev-guide subtree update)

r? @ghost
2026-01-20 09:01:18 +00:00
aerooneqq
f483cb2587 Generate error delegation when delegation is not resolved 2026-01-20 11:32:23 +03:00
Zalathar
694b86e101 rustc_queries!: Don't push the (cache) modifier twice 2026-01-20 18:07:06 +11:00
Stuart Cook
7c33b49e87
Rollup merge of #151391 - rdg-sync, r=tshepang
rustc-dev-guide subtree update

Subtree update of `rustc-dev-guide` to 64f0f77d34.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost
2026-01-20 18:00:11 +11:00
Stuart Cook
8461682729
Rollup merge of #151384 - pm-tokenstream-tests, r=Kivooeo
add basic `TokenStream` api tests

There were none so far. Especially helpful for rust-lang/rust#130856.
2026-01-20 18:00:11 +11:00
Stuart Cook
8221b5e622
Rollup merge of #151375 - terminal_width_independence, r=lqd
Fix terminal  width dependent tests

[#t-compiler > What is -Zui-testing=no and why are we using it](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/What.20is.20-Zui-testing.3Dno.20and.20why.20are.20we.20using.20it/with/568842970)

See zulip thread. I've verified locally that this lets me run the ui test suite without problems even with a very thin terminal 😆
2026-01-20 18:00:10 +11:00
Stuart Cook
0a5d1e8059
Rollup merge of #151255 - fix-rustdoc-ice-reexported-deprecated-note, r=lolbinarycat
rustdoc: Fix ICE when deprecated note is not resolved on the correct `DefId`

Supersedes https://github.com/rust-lang/rust/pull/151237.
Follow-up of rust-lang/rust#151120.

The `span` overlapping approach wasn't good enough so instead we now check if the reexport itself has the `deprecated` attribute, and if so, we resolve the path to the reexport `DefId`, otherwise we resolve it on the reexported item's `DefId`.

cc @Zalathar
r? @lolbinarycat
2026-01-20 18:00:10 +11:00