Repository navigation
Rollup of 8 pull requests - #165597
Merged
Merged
Rollup of 8 pull requests#165597
Conversation
Corresponding libc PR: rust-lang/libc#5555 pollfd has some extra internal fields on NuttX, so we use mem::zeroed() to initialze.
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.
…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`.
…badges, r=notriddle Make notable trait `i` badges `<span>` instead of `<a>` I realized when hovering the `i` that we had the following JS warning: ``` Empty string passed to getElementById(). ``` Which is called in `expandSection`, so nothing related to notable traits. I then realized that the `click` event was added for all `a[href='#']`, which included the `i`. So instead of adding one extra JS check, I preferred to update the `i` tag to better reflect what it is: not a link. r? @notriddle
…r=jieyouxu compiletest: Reject whitespace between `//` & `@` and reject leading revision conditions like (e.g., `//[rev]@ dir`) Regarding whitespace before at-sign, we now hard-error on them. In issue rust-lang#125813, it was suggested to warn on them but IMO a warning is too easy to miss and hard errors aren't super constraining in practice. We now emit a message like this[^1]: ``` ERROR: malformed directive: found whitespace between `//` and `@` at /home/fmease/programming/rust/0/tests/ui/dummy.rs:2 HELP: if you meant to write a directive remove the whitespace to form `//@` HELP: if you meant to literally write `@` in a code comment add `\` before `@` or rewrap the contents of the comment so `@` doesn't come first ``` As you can see from the diff, we actually caught some typo'ed directives! :) Regarding leading revision conditions, we do recognize them even if they're padded with whitespace. For example, both of these get correctly flagged: `//[rev]@dir`, `// [rev] @ dir`. We now emit a message like this[^1]: ``` ERROR: malformed directive: found revision condition before `@` instead of after at /home/fmease/programming/rust/0/tests/ui/dummy.rs:2 HELP: rewrite the start of the line to `//@[rev] ` (from `//[rev]@ `) ``` --- **IMPORTANT**: This PR is meant to be minimal while still robust... I'd just like to fix these two GH issues below, so we can reap the rewards *today*, without thinking about the fact that compiletest is steaming spaghetti code. I don't want to block this on any larger refactorings or redesigns (not to mention the migration to `ui_test`). I *did* resort to refactoring `line_directive` to return a `Result` with a new local `Error` type instead of just `eprint`'ing & `panic`'ing because otherwise I simply can't properly unit-test my changes. I couldn't use `#[should_panic(expected = "$PANIC_MESSAGE")]` because I insist on using both `crate::{error,help}` as they output colors. I guess I could've used `colored` colors inside the panic string but please oh my goodness, let's use the minimal scaffolding we have. Fixes rust-lang#125813 ("`// @`"). Fixes rust-lang#130815 ("`//[rev]@ dir`"). r? @jieyouxu or reassign <sub>(No LLM was or will be used by me during the entire creation process of this PR)</sub> [^1]: `ERROR: ` and `HELP: ` are properly colored & bolded. I'm highlighting that because on unknown directives for example, we write `ERROR` without color, and probably in many other places, too.
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
…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.
Member
Author
Contributor
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Nov 7, 2026
Rollup of 8 pull requests try-job: dist-various-1 try-job: test-various try-job: test-x86_64-gnu-aux try-job: test-x86_64-msvc-1 try-job: test-aarch64-apple-1 try-job: test-aarch64-apple-2 try-job: test-x86_64-mingw-1 try-job: test-i686-msvc try-job: test-armhf-gnu try-job: test-x86_64-gnu-llvm-22-3 try-job: test-aarch64-msvc-2
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Nov 7, 2026
…uwer Rollup of 8 pull requests Successful merges: - #164784 (Introduce OptimizationObjective and fix the entry shim's size attributes) - #165469 (Make notable trait `i` badges `<span>` instead of `<a>`) - #165576 (compiletest: Reject whitespace between `//` & `@` and reject leading revision conditions like (e.g., `//[rev]@ dir`)) - #147696 (Implement `bit` and `set_bit` for integral types.) - #163202 (nuttx: use updated pollfd definition) - #165482 (apply `-Zcrate-attr` attributes before the crate attributes) - #165517 (Migrate basic block ctors to require Terminator where possible) - #165552 (use lang item instead of name when assembling builtin `Clone::clone` instances)
Contributor
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
💔 Test for 66978dc failed: CI. Failed job:
|
Member
Author
|
@bors retry |
This comment has been minimized.
This comment has been minimized.
Contributor
This was referenced Nov 7, 2026
Contributor
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 9358362 (parent) -> cd66957 (this PR) Test differencesShow 7923 test diffsStage 0
Stage 1
Stage 2
Additionally, 7831 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard cd6695728a916cfd91828a4116b296c0f0ca66cc --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
ibadges<span>instead of<a>#165469 (Make notable traitibadges<span>instead of<a>)//&@and reject leading revision conditions (e.g.,//[rev]@ dir) #165576 (compiletest: Reject whitespace between//&@and reject leading revision conditions like (e.g.,//[rev]@ dir))bitandset_bitfor integral types. #147696 (Implementbitandset_bitfor integral types.)-Zcrate-attrattributes before the crate attributes #165482 (apply-Zcrate-attrattributes before the crate attributes)Clone::cloneinstances #165552 (use lang item instead of name when assembling builtinClone::cloneinstances)r? @ghost
Create a similar rollup