Skip to content

Rollup of 8 pull requests - #165595

Closed
Zalathar wants to merge 84 commits into
rust-lang:mainfrom
Zalathar:rollup-3TImalS
Closed

Zalathar wants to merge 84 commits into
rust-lang:mainfrom
Zalathar:rollup-3TImalS

Conversation

@Zalathar

@Zalathar Zalathar commented Nov 7, 2026

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

bjoernager and others added 30 commits October 11, 2026 14:59
…async

Add libc direct tests for `fsync` and `fdatasync`
make fs::copy and io::copy work via fallback
Add test for `accept` with nullptr `address_ptr` argument
This updates the rust-version file to 249cb16.
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Previous upstream ref: rust-lang/rust@349bba6
New upstream ref: rust-lang/rust@249cb16
Filtered ref: rust-lang/miri@06e3752
Upstream diff: rust-lang/rust@349bba6...249cb16

This merge was created using https://github.com/rust-lang/josh-sync.
inform the user when a warning is only shown once
…nat64

Add libc direct tests for `open64` and `openat64`
Albab-Hasan and others added 16 commits November 7, 2026 11:45
rfc 3791 says crate attributes from the command line apply before the attributes in the crate root. ordering-cli checks that several -Zcrate-attr flags apply in command line order. ordering-source records the current behaviour where the command line deny overrides the source warn, which is the wrong way round.
cmdline attributes were pushed after the attributes parsed from source, so a -Zcrate-attr lint level overrode the same lint set in the crate root. rfc 3791 says they apply before the source attributes. they are now inserted at the front of the crate attributes in command line order.
Add libc direct tests for `getcwd` and `chdir`
test too big sockaddr-len on BSD hosts, and some more recvfrom/sendto tweaking
…i-obk

Introduce OptimizationObjective and fix the entry shim's size attributes

~~The MIR inliner's 2 => arm allow-lists `More | Aggressive` by hand. `s/z` also derive MIR level 2, so the pass never runs there. I could not find why in the source or the history — the gate predates the tiered match and read `mir_opt_level() >= 3`, which `s/z` never satisfied either, and `Size/SizeMin` simply were not among the entries considered when the match was written. There is no revert or regression behind it. Dumping every MIR pass at all four levels, the pass sets at `2/3` and at `s/z` differ by exactly one name: Inline. So I enabled it through `PassPolicy::size_only()` and measured.~~

~~The general situation is as follows:~~
~~For the `.text` section in `rlib` files, I tested 24 crates; the results were −3.59% (17/24) for `os` and −5.78% (16/24) for `oz`.
Additional test data includes:~~
~~76-crate sample, Σ stripped: −0.08% (`os`), −0.13% (`oz`)~~
~~22 apps, Σ stripped: −0.09% (`os`), −0.07% (`oz`)~~
~~22 apps, on-disk bytes: −0.40% (7/22) (`os`), −0.74% (11/22) for (`oz`)~~
~~22 apps, Σ .text: +0.18% (`os`), +0.84% ​​(`oz`)~~

~~Is enabling MIR inlining at `s/z` the right direction, given that it clearly shrinks libraries and application binaries on disk while growing application `.text`?~~

*Update*: as @oli-obk asked, the refactoring is now its own commit. The MIR inliner change will move out to another PR. The measurements above are why I still think it is worth doing, but it does not belong in this PR.

When I Split it out I found that LLVM 23 no longer has `Os/Oz` as pipeline levels, they both build the `O2` pipeline now, and what marks a function as size-optimized is the `optsize/minsize` attribute on it. So at `-Copt-level=s/z` there is no longer any setting rustc hands to LLVM that says "this is a size build", it is entirely per-function.

It exposed a gap that the C entry shim and `__rust_try` have no item behind them and never go through the per-item attribute path, so they were the only definitions in a size build that LLVM optimized for speed. They now get the same attributes as everything else.

The refactoring itself gives size-versus-speed a name and moves the sites that are really asking "what is this build optimizing for" onto it. The ones that are asking "how hard" — the linker and pipeline level tables, where `s` and `z` map to different strings, still match on `OptLevel`. `CodeGenOptSize` was already being discarded at its only call site, so it is gone.

There are codegen tests for each knob that now reads the objective, at `2`, `s` and `z`.
Implement `bit` and `set_bit` for integral types.

Tracking issue: rust-lang#147702

This PR implements the `bit` and `set_bit` methods for integral types:

```rust
impl /* uN, iN, usize, isize */ {
    pub const fn bit(self, index: u32) -> bool;

    pub const fn set_bit(self, index: u32, value: bool) -> Self;
}
```
…kruppe

nuttx: use updated pollfd definition

This goes together with this libc PR: rust-lang/libc#5555
…=Urgau

[rustdoc] Render `Deref` methods on aliased items

Fixes rust-lang#134868.
Fixes rust-lang#24686.

The biggest issue was to make it work only for the matching aliased type generics. Luckily for me, it was already done in `write_shared.rs` (where we generate the JS file containing the impls that we then put into the generated web pages, which makes me wonder why we don't put that directly into the page by default, but debate for another day...).

r? @lolbinarycat
…i-obk

apply `-Zcrate-attr` attributes before the crate attributes

part of rust-lang#138287. `-Zcrate-attr` attributes were appended after the source crate attrs so `-Zcrate-attr=deny(unused)` overrode a source `#![warn(unused)]`. rfc 3791 says they apply first. this inserts them at the front in command line order and adds two ordering tests. the edition and position tests landed separately in rust-lang#165429 so i dropped mine.

r? oli-obk
… r=folkertdev

Migrate basic block ctors to require Terminator where possible

This is a step towards replacing `Option<Terminator>` with `Terminator` in `BasicBlockData`. See [this thread](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/vibe.20check.20-.20removing.20Option.20from.20Terminator/with/637588808) for more info.

This commit changes `BasicBlockData` constructors to require `Terminator`. For callsites where this is not yet possible, it keeps existing constructors with `Option` under different names. These are intentionally more verbose to point people towards the new ones.

There should be no behaviour change.
…m, r=folkertdev

use lang item instead of name when assembling builtin `Clone::clone` instances

Just a little code cleanup / fixme fixme.
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Nov 7, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-networking Area: `std::net` O-unix Operating system: Unix-like S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Nov 7, 2026
@rust-bors

rust-bors Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

PR #163571, which is a member of this rollup, was unapproved.

@Zalathar Zalathar closed this Nov 7, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 7, 2026
@Zalathar
Zalathar deleted the rollup-3TImalS branch November 7, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-networking Area: `std::net` O-unix Operating system: Unix-like rollup A PR which is a rollup T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.