Commit Graph

334231 Commits

Author SHA1 Message Date
Vadim Petrochenkov
2b4375dadc rustc: Support --jobs options for limiting parallelism in various parts of the compiler 2026-07-29 15:22:16 +03:00
bors
ce69831677 Auto merge of #160112 - jhpratt:rollup-6M1V5yA, r=jhpratt
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#158168 (Added implementation on `set_permissions_nofollow` for all primary platforms)
 - rust-lang/rust#160055 (Simplify `MaybeRequiresStorage`)
 - rust-lang/rust#157226 (Partially stabilize `box_vec_non_null`)
 - rust-lang/rust#158879 (simplify `slice::Iter[Mut]::next_chunk` implementation)
 - rust-lang/rust#159413 (Enable `#[diagnostic::on_unknown]` during late res)
 - rust-lang/rust#160091 (Fix rustdoc toolbar height when title is taller than one line)
 - rust-lang/rust#158615 (fix: don't fire `explicit_outlives_requirements` on `?Sized` type params)
 - rust-lang/rust#159666 (fix(ld64.lld): route version mismatch warnings to linker_info on macOS)
 - rust-lang/rust#160032 (rustdoc-json: Make `Stability` compatible with non-self-describing serde formats)
 - rust-lang/rust#160039 (Add regression test for enum unconstrained parameter )
 - rust-lang/rust#160049 (Use assert_eq! in splat codegen tests)
2026-07-29 05:25:04 +00:00
Jacob Pratt
4a7ab6f065 Rollup merge of #160049 - teor2345:splat-test-assert-eq, r=folkertdev
Use assert_eq! in splat codegen tests

Tracking issue: rust-lang/rust#153629

This PR does some cleanups in the splat UI tests from folkert's PR rust-lang/rust#159643 review:
- move rustfmt::skip to main() and deduplicate it: https://github.com/rust-lang/rust/pull/159643#discussion_r3650148585
- use assert_eq!() to test codegen rather than println!(): https://github.com/rust-lang/rust/pull/159643#discussion_r3650150884
- delete resolved FIXME comments about supporting tupled and de-tupled calls to splatted functions

r? @folkertdev

@rustbot label +F-splat +C-cleanup
2026-07-28 20:09:42 -04:00
Jacob Pratt
75dd89e21d Rollup merge of #160039 - chenyukang:yukang-fix-159811-enum-unconstrained-test, r=JohnTitor
Add regression test for enum unconstrained parameter

Fixes rust-lang/rust#159811

It's fixed by https://github.com/rust-lang/rust/pull/157846
2026-07-28 20:09:41 -04:00
Jacob Pratt
e983685e4b Rollup merge of #160032 - aDotInTheVoid:push-svrwoqqpoxsu, r=GuillaumeGomez
rustdoc-json: Make `Stability` compatible with non-self-describing serde formats

Using `#[serde(flatten)]` and `#[serde(tag = "` break using rustdoc-json-types with serde serializers like postcard. rustdoc-json-types should work with these, even if rustdoc itself doesn't use this yet.

This is a breaking change to the `FORMAT_VERSION` even though rust reader/writer code is uneffected.

cc @obi1kenobi
r? @GuillaumeGomez
2026-07-28 20:09:40 -04:00
Jacob Pratt
05cfae5147 Rollup merge of #159666 - r3v5:fix-llvm-ld64-lld-linker-stderr-warnings, r=petrochenkov
fix(ld64.lld): route version mismatch warnings to linker_info on macOS

r? jyn514

Fixes rust-lang/rust#159227

**Issue:** .o objects (e.g. precompiled stdlib .rlib files, C libraries compiled via cc-rs) receive MacOS version of the machine they were compiled on and that version is much higher than Rust's default deployment target for aarch64-apple-darwin which is macOS 11.0.0.

[`(Os::MacOs, crate::spec::Arch::AArch64, _) => (11, 0, 0)`](f65b272fc9/compiler/rustc_target/src/spec/base/apple/mod.rs (L332))

 That’s why hundreds of warning logs appear such as warning: `linker stderr: rust-lld: /path/file.rlib(file.o) has version 26.4.1, which is newer than target minimum of 11.0.0`. These warnings were already filtered for ld64 and ld_prime but not for lld (see rust-lang/rust#136113).

**Root cause:** I believe that the current function `is_macos_ld()` in [compiler/rustc_codegen_ssa/src/back/link.rs](730a6b5dce/compiler/rustc_codegen_ssa/src/back/link.rs (L874)) handles the case when we use native macOS linker so the entire filtering chain in linker output is skipped when using ld64.lld. Relevant code:

```
fn is_macos_ld(sess: &Session) -> bool {
    let (_, flavor) = linker_and_flavor(sess);
    sess.target.is_like_darwin && matches!(flavor, LinkerFlavor::Darwin(_, Lld::No))

}
```
So, `Lld::No` means using native macOS linker, so when lld is used via `Lld::Yes`, the match fails and the function returns `false` hence all warnings come from stderr to linker_messages which are visible.

**My proposed solution:** modify filtering such that it runs for lld too and add a new specific ld64.lld warning pattern routing warnings to linker_info to make them invisible by default.
2026-07-28 20:09:39 -04:00
Jacob Pratt
cc89039c4a Rollup merge of #158615 - Albab-Hasan:fix-explicit-outlives-unsized, r=fmease
fix: don't fire `explicit_outlives_requirements` on `?Sized` type params

`explicit_outlives_requirements` uses `tcx.inferred_outlives_of()` to check whether an explicit `T: 'a` bound is structurally implied by struct fields. for a field `r: &'a T`, it is — so the lint fired and suggested removing it.

but RFC 599 object lifetime defaults are computed from *explicit* HIR bounds not inferred ones. removing an explicit `T: 'a` from a `?Sized` type param silently changes every `Struct<dyn Trait>` use from `dyn Trait + 'a` to `dyn Trait + 'static`, breaking callers without any error.

added a guard: before emitting the lint for a type param outlives bound, check whether the param carries any `?Sized` bound (`BoundPolarity::Maybe` in HIR). if so, skip — the bound may be the sole anchor for the object lifetime default.

also suppresses the pre-existing false positive in `edition-lint-infer-outlives.rs` (noted in issue https://github.com/rust-lang/rust/issues/105150) which was an instance of the same bug.

closes https://github.com/rust-lang/rust/issues/134902
2026-07-28 20:09:38 -04:00
Jacob Pratt
dccf2ca6a0 Rollup merge of #160091 - GuillaumeGomez:rustdoc-toolbar-buttons, r=notriddle
Fix rustdoc toolbar height when title is taller than one line

Fixes https://github.com/rust-lang/rust/issues/160086.

With the fix:

<img width="814" height="238" alt="image" src="https://github.com/user-attachments/assets/5a8edb52-bc6e-44e7-943c-85a73f21e81e" />

r? @notriddle
2026-07-28 20:09:38 -04:00
Jacob Pratt
37c1398c2f Rollup merge of #159413 - mejrs:on_unknown_late, r=nnethercote
Enable `#[diagnostic::on_unknown]` during late res

The pr prior to this is rust-lang/rust#157926. That PR enabled it for early res, this PR does so for late res.

r? @estebank
2026-07-28 20:09:37 -04:00
Jacob Pratt
8c6ef9fb36 Rollup merge of #158879 - WaffleLapkin:slice_iter_next_chunk_simp, r=JohnTitor
simplify `slice::Iter[Mut]::next_chunk` implementation

I verified that this doesn't pessimize codegen using the example from the PR that inroduced the optimization of `next_chunk` (rust-lang/rust#149131):

```rust
#![feature(iter_next_chunk)]

#[no_mangle]
pub fn simd_sum_slow(arr: &[u32]) -> u32 {
    const STEP_SIZE: usize = 16;

    let mut result = [0; STEP_SIZE];

    let mut iter = arr.iter();

    while let Ok(c) = iter.next_chunk::<STEP_SIZE>() {
        for (&n, r) in c.iter().zip(result.iter_mut()) {
            *r += n;
        }
    }

    result.iter().sum()
}
```

I compiled this example with
```shell
./build/host/stage1/bin/rustc t.rs --emit=asm -O --crate-type=lib
```

Before and after this change; the only difference is the choice of the jump instruction, which I think shouldn't make any difference:

```diff
28,29c28,29
< 	cmpq	$64, %rsi
< 	jae	.LBB0_2
---
> 	cmpq	$60, %rsi
> 	ja	.LBB0_2
```

r? libs
cc @bend-n
2026-07-28 20:09:36 -04:00
Jacob Pratt
c5ea97ed50 Rollup merge of #157226 - theemathas:stab-box-vec-non-null, r=nia-e
Partially stabilize `box_vec_non_null`

Closes rust-lang/rust#130364

r? libs-api

### What's being stabilized

The following is being stabilized in this PR:

```rust
impl<T: ?Sized> Box<T> {
    pub unsafe fn from_non_null(ptr: NonNull<T>) -> Self { .... }
    pub fn into_non_null(b: Self) -> NonNull<T> { .... }
}
impl<T> Vec<T> {
    pub const unsafe fn from_parts(ptr: NonNull<T>, length: usize, capacity: usize) -> Self { .... }
    pub const fn into_parts(self) -> (NonNull<T>, usize, usize) { .... }
}
```

Note that `Vec::from_parts` and `Vec::into_parts` remain const-unstable behind the `const_heap` feature (like `Vec::from_raw_parts` and `Vec::into_raw_parts`).

The following APIs remain gated behind `allocator_api`
```rust
impl<T: ?Sized, A: Allocator> Box<T, A> {
    pub unsafe fn from_non_null_in(raw: NonNull<T>, alloc: A) -> Self { .... }
    pub fn into_non_null_with_allocator(b: Self) -> (NonNull<T>, A) { .... }
}
impl<T, A: Allocator> Vec<T, A> {
    pub const unsafe fn from_parts_in(ptr: NonNull<T>, length: usize, capacity: usize, alloc: A) -> Self { .... }
    pub const fn into_parts_with_alloc(self) -> (NonNull<T>, usize, usize, A) { .... }
}
```

The following API is split into a new unstable feature in rust-lang/rust#157843, and remains unstable:
```rust
impl<T, A: Allocator> Vec<T, A> {
    pub const fn as_non_null(&mut self) -> NonNull<T> { .... }
}
```

### Implementation History

Most of this feature was ACP'ed in https://github.com/rust-lang/libs-team/issues/418, and implemented in https://github.com/rust-lang/rust/pull/130061. `Vec::as_non_null` was ACP'ed separately in https://github.com/rust-lang/libs-team/issues/440, and implemented in https://github.com/rust-lang/rust/pull/130624.

### Potential issues

* Should `Vec::from_parts` and `Vec::into_parts` be the name used for this? Or should those names be used for functions that take/return `Box<[MaybeUninit<T>]>`? (Raised at https://github.com/rust-lang/rust/issues/130364#issuecomment-2357276951)
* Should these function names be named `non_null` or `nonnull`? (Raised at https://github.com/rust-lang/rust/issues/130364#issuecomment-4525680948. See https://github.com/rust-lang/rust/issues/154237#issuecomment-4120073976.)
* Will the methods on `Vec` collide with anything via autoderef?
2026-07-28 20:09:36 -04:00
Jacob Pratt
108fa3e080 Rollup merge of #160055 - nnethercote:simplify-MaybeRequiresStorage, r=cjgillot
Simplify `MaybeRequiresStorage`

It currently contains a `MaybeBorrowedLocals` cursor. The cursor is within a `RefCell` because cursor traversal requires mutation. The cursor is used in the `MaybeRequiresStorage::check_for_move` operation.

Instead of using this cursor within `MaybeRequiresStorage` it's possible to do a pre-traversal of `MaybeBorrowedLocals` to extract the necessary information and then give that (immutably) to `MaybeRequiresStorage`.

This commit makes that change. The extracted information is in the new `KillableLocals` type, which is computed by the `KillableLocalsVisitor` type within `MaybeRequiresStorage::new`. `MaybeRequiresStorage` no longer needs lifetimes. `MoveVisitor` is no longer needed. And the complicated `locals_live_across_suspend_points` gets a little simpler.

r? @cjgillot
2026-07-28 20:09:35 -04:00
Jacob Pratt
04e2f01a99 Rollup merge of #158168 - asder8215:windows_set_permissions_nofollow, r=clarfonthey
Added implementation on `set_permissions_nofollow` for all primary platforms

For context, this PR is related to the tracking issue for [`std::fs::set_permissions_nofollow`](https://github.com/rust-lang/rust/issues/141607). This PR does a few different things:

* Windows support is provided for `std::fs::set_permissions_nofollow`. On Windows, it uses `OpenOptions::open` with the custom flag `FILE_FLAG_OPEN_REPARSE_POINT` enabled and then sets the permissions on the reparse point directly. All other platforms (hermit, motor, solid, uefi, etc.) defer to what `fs::set_permissions` does since symlinks aren't supported on those platforms, so they effectively do the same thing.
* The implementation for Unix was modified to use [`fchmodat`](https://linux.die.net/man/2/fchmodat) instead of doing two separate calls (`open` and then `fchmod` via `OpenOptions`).
* Because the previous implementations actually used `fchmod` instead of `chmod` underneath the hood (as that's what `File::set_permissions`, which is not to be confused with `fs::set_permissions` as that does use `chmod`, does underneath the hood), it actually had some incorrect documentation about the error returned by `fchmod` on symlinks. Instead of `io::ErrorKind::FilesystemLoop`, it returns `io::ErrorKind::InvalidInput`. You can read the documentation for [`fchmod`](https://pubs.opengroup.org/onlinepubs/009696699/functions/fchmod.html). `fchmodat` does effectively the same thing as the `open` + `fchmod` combo, but it does return a different error, `io::ErrorKind::Unsupported`, that makes more sense. Regardless, I corrected the documentation for `std::fs::set_permissions_nofollow` and added a lot more clarifying information.
* A test case has been added to verify if `set_permissions_nofollow` is operating correctly.

cc @ChrisDenton and @lolbinarycat
2026-07-28 20:09:34 -04:00
bors
701a6513a4 Auto merge of #159854 - camelid:selfty-head, r=notriddle,GuillaumeGomez
rustdoc: Only analyze head of self type when deciding impl inlining



We only care about whether the self type is a generic or an item (inlined) in
the current crate, so we don't actually need to compute the param_env, which is
expensive when done to every external impl.  This PR avoids computing the
param_env until we actually decide to inline the impl.  Moreover, it adds
specialized cleaning logic for types that stops after the "head" (the top-level
structure) is constructed, which is enough for the self type-based impl
inlining analysis.
2026-07-28 22:40:33 +00:00
León Orell Valerian Liehr
bf49633fdf Add note about object lifetime defaulting to description of lint explicit_outlives_requirements 2026-07-28 23:36:20 +02:00
Nicholas Nethercote
0f0b9f8981 Simplify MaybeRequiresStorage
It currently contains a `MaybeBorrowedLocals` cursor. The cursor is
within a `RefCell` because cursor traversal requires mutation. The
cursor is used in the `MaybeRequiresStorage::check_for_move` operation.

Instead of using this cursor within `MaybeRequiresStorage` it's possible
to do a pre-traversal of `MaybeBorrowedLocals` to extract the necessary
information and then give that (immutably) to `MaybeRequiresStorage`.

This commit makes that change. The extracted information is in the new
`KillableLocals` type, which is computed by the `KillableLocalsVisitor`
type within `MaybeRequiresStorage::new`. `MaybeRequiresStorage` no
longer needs lifetimes. `MoveVisitor` is no longer needed. And the
complicated `locals_live_across_suspend_points` gets a little simpler.
2026-07-29 06:58:04 +10:00
bors
26ae60a9ee Auto merge of #160102 - JonathanBrouwer:rollup-0WT4269, r=JonathanBrouwer
Rollup of 21 pull requests

Successful merges:

 - rust-lang/rust#159990 (Many "predicate"-to-"clause" renamings)
 - rust-lang/rust#159665 (Replace most `Ty::new_fn_def` calls with `type_of` queries directly)
 - rust-lang/rust#159687 (rustdoc: Set tracing max_level_info when debug-logging is false)
 - rust-lang/rust#160057 (refactor(mir-transform): Calculate optimization status inside `run_passes_inner`)
 - rust-lang/rust#160060 (codegen: skip stores for entirely-uninit constant aggregate fields, attempt rust-lang/rust#2)
 - rust-lang/rust#160063 (Fix ICE when dumping the dep graph with the parallel frontend)
 - rust-lang/rust#160065 (Distinguish the dep-graph index space from the live node count)
 - rust-lang/rust#158038 (Split register_tool into register_attribute_tool and register_lint_tool)
 - rust-lang/rust#159776 (remove const hack in alloc)
 - rust-lang/rust#159978 (run intrinsic-test by default on x86_64-gnu)
 - rust-lang/rust#160008 (Avoid stale closure recovery state across statements)
 - rust-lang/rust#160027 (Add regression test for rust-lang/rust#132767)
 - rust-lang/rust#160030 (Update `browser-ui-test` version to `0.25.0`)
 - rust-lang/rust#160046 (Improve consistency of attribute error messages (part 2))
 - rust-lang/rust#160056 (Fix associated function suggestion for generic ADTs)
 - rust-lang/rust#160069 (Update Rust crate tracing-subscriber to v0.3.23 [SECURITY])
 - rust-lang/rust#160071 (sanitize_standard_fds: clarify macos comment)
 - rust-lang/rust#160076 (use unstable features when updating dependencies)
 - rust-lang/rust#160092 (miri ui tests: don't run native tests on stage 0)
 - rust-lang/rust#160093 (Switch cargo assignments to weihanglo)
 - rust-lang/rust#160094 (Update assignment for docs)
2026-07-28 19:13:41 +00:00
Jonathan Brouwer
4247c21975 Rollup merge of #160094 - ehuss:triagebot-lang-docs, r=traviscross
Update assignment for docs

I'm updating the docs to point to lang-docs instead of just myself.

r? traviscross
2026-07-28 21:08:10 +02:00
Jonathan Brouwer
dfea7b5f81 Rollup merge of #160093 - ehuss:triagebot-cargo, r=weihanglo
Switch cargo assignments to weihanglo

r? weihanglo
2026-07-28 21:08:09 +02:00
Jonathan Brouwer
02a88ad362 Rollup merge of #160092 - RalfJung:miri-native, r=oli-obk
miri ui tests: don't run native tests on stage 0

This seems to always fail. There's probably a way to make it work, but IMO it's enough if the native tests run in rustc CI (and in the Miri repo of course).

r? @oli-obk
2026-07-28 21:08:08 +02:00
Jonathan Brouwer
b5630173c6 Rollup merge of #160076 - marcoieni:renovate-lockfile-update-fix, r=Kobzol
use unstable features when updating dependencies

r? @Kobzol
2026-07-28 21:08:07 +02:00
Jonathan Brouwer
bed06a394b Rollup merge of #160071 - RalfJung:sanitize_standard_fds, r=clarfonthey
sanitize_standard_fds: clarify macos comment

Thanks to @tmiasko for remembering the missing context.
2026-07-28 21:08:06 +02:00
Jonathan Brouwer
6d0520c312 Rollup merge of #160069 - renovate-bot:renovate/crate-tracing-subscriber-vulnerability, r=jieyouxu
Update Rust crate tracing-subscriber to v0.3.23 [SECURITY]

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [tracing-subscriber](https://tokio.rs) ([source](https://redirect.github.com/tokio-rs/tracing)) | dependencies | patch | `0.3.22` → `0.3.23` |
| [tracing-subscriber](https://tokio.rs) ([source](https://redirect.github.com/tokio-rs/tracing)) | dev-dependencies | patch | `0.3.22` → `0.3.23` |

---

###  Tracing logging user input may result in poisoning logs with ANSI escape sequences
[CVE-2025-58160](https://nvd.nist.gov/vuln/detail/CVE-2025-58160) / [GHSA-xwfj-jgwm-7wp5](https://redirect.github.com/advisories/GHSA-xwfj-jgwm-7wp5)

<details>
<summary>More information</summary>

#### Details
##### Impact

Previous versions of tracing-subscriber were vulnerable to ANSI escape sequence injection attacks. Untrusted user input containing ANSI escape sequences could be injected into terminal output when logged, potentially allowing attackers to:

- Manipulate terminal title bars
- Clear screens or modify terminal display
- Potentially mislead users through terminal manipulation

In isolation, impact is minimal, however security issues have been found in terminal emulators that enabled an attacker to use ANSI escape sequences via logs to exploit vulnerabilities in the terminal emulator.

##### Patches

`tracing-subscriber` version 0.3.20 fixes this vulnerability by escaping ANSI control characters in when writing events to destinations that may be printed to the terminal.

##### Workarounds

Avoid printing logs to terminal emulators without escaping ANSI control sequences.

##### References

https://www.packetlabs.net/posts/weaponizing-ansi-escape-sequences/

##### Acknowledgments

We would like to thank [zefr0x](http://github.com/zefr0x) who responsibly reported the issue at `security@tokio.rs`.

If you believe you have found a security vulnerability in any tokio-rs project, please email us at `security@tokio.rs`.

#### Severity
- CVSS Score: 2.3 / 10 (Low)
- Vector String: `CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N`

#### References
- [https://github.com/tokio-rs/tracing/security/advisories/GHSA-xwfj-jgwm-7wp5](https://redirect.github.com/tokio-rs/tracing/security/advisories/GHSA-xwfj-jgwm-7wp5)
- [https://nvd.nist.gov/vuln/detail/CVE-2025-58160](https://nvd.nist.gov/vuln/detail/CVE-2025-58160)
- [https://rustsec.org/advisories/RUSTSEC-2025-0055.html](https://rustsec.org/advisories/RUSTSEC-2025-0055.html)
- [https://github.com/advisories/GHSA-xwfj-jgwm-7wp5](https://redirect.github.com/advisories/GHSA-xwfj-jgwm-7wp5)

This data is provided by the [GitHub Advisory Database](https://redirect.github.com/advisories/GHSA-xwfj-jgwm-7wp5) ([CC-BY 4.0](https://redirect.github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>

---

### Release Notes

<details>
<summary>tokio-rs/tracing (tracing-subscriber)</summary>

### [`v0.3.23`](https://redirect.github.com/tokio-rs/tracing/releases/tag/tracing-subscriber-0.3.23): tracing-subscriber 0.3.23

[Compare Source](https://redirect.github.com/tokio-rs/tracing/compare/tracing-subscriber-0.3.22...tracing-subscriber-0.3.23)

##### Fixed

- Allow ansi sanitization to be disabled ([#&rust-lang/rust#8203;3484])

[#&rust-lang/rust#8203;3484]: https://redirect.github.com/tokio-rs/tracing/pull/3484

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/rust-lang/rust).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yODAuMCIsInVwZGF0ZWRJblZlciI6IjQzLjI4MC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
2026-07-28 21:08:05 +02:00
Jonathan Brouwer
e5209b88af Rollup merge of #160056 - chenyukang:yukang-fix-159813-assoc-fn-turbofish, r=estebank
Fix associated function suggestion for generic ADTs

Fixes rust-lang/rust#159813

r? @estebank
2026-07-28 21:08:04 +02:00
Jonathan Brouwer
54e4c45caa Rollup merge of #160046 - nnethercote:attr-errors-2, r=estebank
Improve consistency of attribute error messages (part 2)

A sequel to rust-lang/rust#159755.

r? @estebank
2026-07-28 21:08:03 +02:00
Jonathan Brouwer
fe0ebeee4d Rollup merge of #160030 - GuillaumeGomez:update-browser-ui-test, r=GuillaumeGomez
Update `browser-ui-test` version to `0.25.0`

With this new version we should be able to finally add a regression test for [the "code copy" ](https://github.com/rust-lang/rust/pull/158137).

r? ghost
2026-07-28 21:08:02 +02:00
Jonathan Brouwer
1cb8d93aa7 Rollup merge of #160027 - zakrad:regr-test-132767, r=chenyukang
Add regression test for #132767

Closes rust-lang/rust#132767. Coercing a fn item to a fn pointer with an associated type projection used to ICE during normalization. now errors with E0277.
2026-07-28 21:08:01 +02:00
Jonathan Brouwer
9e4d2e62c7 Rollup merge of #160008 - TaKO8Ki:fix-stale-closure-recovery, r=mati865
Avoid stale closure recovery state across statements

Fixes rust-lang/rust#159989

`current_closure` was cleared when starting a new expression through `parse_expr`, but statement expressions call `parse_expr_res` directly. This allowed closure recovery state from one statement to remain active while parsing the next statement.

This pr clears `current_closure` when entering `parse_stmt_without_recovery`, matching the behavior of `parse_expr`.

da2697d1d8/compiler/rustc_parse/src/parser/expr.rs (L55-L56)

da2697d1d8/compiler/rustc_parse/src/parser/expr.rs (L63-L64)
2026-07-28 21:07:59 +02:00
Jonathan Brouwer
7183dd5471 Rollup merge of #159978 - xonx4l:x86-intrinsic-test-default, r=Kobzol
run intrinsic-test by default on x86_64-gnu

This PR runs intrinsic-test by default on x86_64-gnu and set sde bootstrap config in `RUST_CONFIGURE_ARGS` .

r? @Kobzol
2026-07-28 21:07:58 +02:00
Jonathan Brouwer
82b7eea6d0 Rollup merge of #159776 - Syvraa:main, r=LawnGnome
remove const hack in alloc

Seems like this change was missed when other const hacks were removed.
2026-07-28 21:07:57 +02:00
Jonathan Brouwer
bca856424e Rollup merge of #158038 - nbdd0121:register_tool, r=mejrs
Split register_tool into register_attribute_tool and register_lint_tool

Tracking issue: rust-lang/rust#66079

This implements the attribute parsing part of RFC 3808. The resolution part is yet to be implemented.

cc @jyn514
2026-07-28 21:07:45 +02:00
Jonathan Brouwer
aff2e658ba Rollup merge of #160065 - xmakro:cleanup/dep-graph-index-space-len, r=cjgillot
Distinguish the dep-graph index space from the live node count

`SerializedDepGraph::node_count()` returns `nodes.len()`, the size of the index space, which includes indices that batch allocation left unused. In the same file, the local `node_count` in `decode` is the number of nodes actually encoded. The two differ and are easy to confuse.
2026-07-28 21:07:44 +02:00
Jonathan Brouwer
cffcbceaa4 Rollup merge of #160063 - xmakro:fix/parallel-dump-dep-graph-ice, r=petrochenkov
Fix ICE when dumping the dep graph with the parallel frontend

`-Zquery-dep-graph -Zdump-dep-graph` ICEs whenever `-Zthreads` is greater than 1:

```console
$ echo 'fn main() {}' > foo.rs
$ rustc -C incremental=incr -Zquery-dep-graph -Zdump-dep-graph -Zthreads=2 foo.rs
thread 'rustc' panicked at compiler/rustc_middle/src/dep_graph/retained.rs:40:63:
called `Option::unwrap()` on a `None` value
```

Reproduces on nightly on 15 of 15 runs at `-Zthreads` 2, 4 and 8. `-Zthreads=1` passes.

Dep-graph indices are handed to threads in batches of 256 and `EncoderState::finish` abandons each worker's unused tail, so `LinkedGraph::add_node_with_idx` back-fills the skipped slots with `data: None`. `RetainedDepGraph::nodes` unwrapped every slot, instead we skip the empty ones.
2026-07-28 21:07:43 +02:00
Jonathan Brouwer
7f6e2de176 Rollup merge of #160060 - glandium:issue159867, r=oli-obk
codegen: skip stores for entirely-uninit constant aggregate fields, attempt #2

This reverts both rust-lang/rust#159825 and rust-lang/rust#157797, and goes back to the original fix from rust-lang/rust#157797, albeit with a small refactor to share code between the now three branches that do the same check. This preserves the original issue (rust-lang/rust#157743) in a fixed state, but avoids the whack-a-mole the initially landed attempt created.

Fixes: rust-lang/rust#159867

r? @oli-obk
2026-07-28 21:07:42 +02:00
Jonathan Brouwer
304834733b Rollup merge of #160057 - clubby789:local-optimizations, r=RalfJung
refactor(mir-transform): Calculate optimization status inside `run_passes_inner`

The `Optimizations` enum represents whether `#[optimize(none)]` has been applied to a function. Currently, `run_passes` takes an `Optimizations` which is confusing (https://github.com/rust-lang/rust/pull/160015#discussion_r3663238318).
Calculate this in `run_passes_inner` instead (which also means `#[optimize(none)]` is applied more consistently.

r? @RalfJung
2026-07-28 21:07:41 +02:00
Jonathan Brouwer
7d73f93383 Rollup merge of #159687 - camelid:rustdoc-max_level_info, r=Mark-Simulacrum
rustdoc: Set tracing max_level_info when debug-logging is false

This matches rustc and should improve performance for the published versions of rustdoc. We shouldn't be including all our `debug!` calls in builds for users.
2026-07-28 21:07:40 +02:00
Jonathan Brouwer
1da9319614 Rollup merge of #159665 - addiesh:turbofish-fear-me, r=oli-obk
Replace most `Ty::new_fn_def` calls with `type_of` queries directly

This is so we can reduce the amount of code and changes in rust-lang/rust#159403. It should stand on its own, but really it's meant as an extended part of 159403.

This allows getting the right `ty::FnDef` even cross-crate, as the `type_of` query results are stored in metadata, in contrast to the queries for computing the binder for various declarations. These binders are already cached via `fn_sig`, but using that is somewhat overkill and can cause cycle errors in some cases.
2026-07-28 21:07:39 +02:00
Jonathan Brouwer
0a1a25a0b6 Rollup merge of #159990 - nnethercote:predicate-to-clause, r=oli-obk
Many "predicate"-to-"clause" renamings

Lots of names weren't changed to account for the introduction of the `Clause` type as a specialized form of `Predicate`, presumably because it was tedious. This commit converts as many of them as I could find. It's mostly very tedious renamings of types, functions, variables, and queries. The more interesting ones are a couple of files (`predicates_of.rs`, `impossible_predicates.rs`) and a MIR pass (`ImpossiblePredicates`).

r? @oli-obk
2026-07-28 21:07:39 +02:00
Noah Lev
27c97d1380 rustdoc: Remove unneeded branches, add test 2026-07-28 16:51:55 +00:00
Noah Lev
40a4f80d49 rustdoc: Only analyze head of self type when deciding impl inlining
The last commit removed the expensive param_env computation since we
only need to look at the "head" of the self type (i.e. the top-level
structure) when making impl inlining decisions. This commit makes that
change more sound and improves on it further by creating specialized
cleaning logic for types that stops after the head is constructed.
2026-07-28 16:51:55 +00:00
Eric Huss
c3409789fd Update assignment for docs
I'm updating the docs to point to lang-docs instead of just myself.
2026-07-28 09:45:50 -07:00
Eric Huss
65b40f5366 Switch cargo assignments to weihanglo 2026-07-28 09:32:52 -07:00
Ralf Jung
ec6c779631 miri ui tests: don't run native tests on stage 0 2026-07-28 18:25:45 +02:00
Guillaume Gomez
e9ca1abeed Add regression test for rustdoc toolbar buttons height 2026-07-28 18:11:54 +02:00
Guillaume Gomez
39d081f663 Fix rustdoc toolbar height when title is taller than one line 2026-07-28 18:11:37 +02:00
Ian Miller
62c5cdd8ea fix(lld): route version mismatch warnings to linker_info on macOS
Broaden `is_macos_ld` to `is_macos_linker` by matching `Darwin(..)`
instead of `Darwin(_, Lld::No)`, so the linker output filtering also
runs when lld is used. Add lld-specific version mismatch pattern to
`deployment_mismatch` closure, routing these warnings to `linker_info`
(default Allow) instead of `linker_messages` (default Warn).

Add a real-lld sub-test to `macos-deployment-target-warning` that
exercises the `ld64.lld` path via `-fuse-ld=`, verifying lld warnings
are normalized and routed to `linker_info`.

Signed-off-by: Ian Miller <milleryan2003@gmail.com>
2026-07-28 15:28:16 +01:00
addie.sh
7b8f260f7e Replace most Ty::new_fn_def calls with type_of queries directly 2026-07-28 16:08:10 +02:00
MarcoIeni
0d16cb17db use unstable features when updating dependencies 2026-07-28 15:20:44 +02:00
Ralf Jung
c35d330f1d sanitize_standard_fds: clarify macos comment 2026-07-28 15:03:16 +02:00
mejrs
bf4f8c1713 remove duplicate local 2026-07-28 14:55:38 +02:00