Rollup of 9 pull requests - #163439
Rollup of 9 pull requests#163439
Conversation
When it was added in PR 37412 it was a simple three-value lattice type implementing `PartialOrd`/`Ord`, and also implementing `BitAnd`/`BitOr` using `min`/`max`. This all made sense. Then in PR 64592 the `Always` variant got a span and a custom note added. This makes the meaning of all those operations much murkier. And the `is_always` method gained an alarming comment: > Enum comparison ignores the contents of fields, so we just fill them > in with garbage here. This is false! Enum comparison does use the contents of fields. This commit removes the `PartialOrd`/`Ord` impls and redoes `BitAnd`/`BitOr` in a way that preserves existing behaviour without relying on `span` and `custom_note` ordering. In the `Always`/`Always` case we now always use the fields from `self`; this is potentially different to the old behaviour but in practice no test outputs are affected, and at most some error messages might be slightly different. This helps with the next commit by removing some `Span` ordering operations.
The rustc driver sets the default stack size to 16MB, however worker threads spawned by the backend will use std's default stack size (usually 2MB). Pass through the stack size chosen by the driver to the backend, and explicitly request the stack size.
On most platforms, `send` takes a `size_t` length, but returns an `ssize_t` count of bytes written. This means that the actual limit is `ssize_t::MAX`, not `size_t::MAX`. QNX has a bug on top of this, where the returned length appears to be converted to a C `int` and back, resulting in the wrong return value if the length is >= 2^31 bytes.
`Span` and `SpanData` encode four fields: `lo`/`hi`, `ctxt`, and `parent`. `ctxt` and `parent` have unorderable types. Both types ignore `ctxt` and `parent` for `PartialOrd`/`Ord`. But their `PartialEq`/`Eq` impls do *not* ignore those fields. This eq/ord inconsistency is a bug. It was introduced in rust-lang#123165. The idea of ordering spans in general is dubious, because of `ctxt` and `parent`. But the idea of ordering spans just with `lo`/`hi` is fine. Therefore, this commit does the following. - Removes the `PartialOrd`/`Ord` impls for `Span`/`SpanData` - Adds a `Span::lo_hi` method which can be used in lots of places where span locations are involved in sorting. E.g. `xs.sort_by_key(|span| span.lo_hi())` - Adds `OrdSpan`, a newtype around `Span` that impls `PartialEq`/`Eq`/`PartialOrd`/`Ord` using `lo_hi`. This is for storing spans in ordered types like `BTreeMap<OrdSpan, T>`. Note also that some `sort`+`dedup` combinations might not remove all duplicates with the old eq/ord inconsistency. These now all do the right thing, which could affect some error messages, though in practice nothing in the test suite is affected.
It can be replaced with `Span::lo_hi` + `==`.
…s-rachel
Fix maximum `send` length on non-{Mac, Windows} platforms
On these platforms, `send` takes a `size_t` length, but returns an `ssize_t` count of bytes written. This means that the actual limit is `ssize_t::MAX`, not `size_t::MAX`.
On QNX, the limit needs to be reduced further, to `c_int::MAX` (just like for Mac), because larger `send` calls return incorrect counts of bytes written.
… r=petrochenkov fix ice for unresolved inherent delegation fixes: [162774](rust-lang#162774) also adds a regression test for the ICE. plus follow-up commits addressing review feedback on error propagation for `TypeRelativeDelegationRes::Error`.
… r=jieyouxu x perf takes database path r? @jieyouxu (or anyone else who wants, it's not a very complicated change) > [!NOTE] > I've not used an LLM for any part of this PR, or any other PR I make. This includes any related work like research.
…anBrouwer Move the foreign module #[link] ABI check to attribute parsing Addresses rust-lang#153101. This moves the `#[link]` check for `extern "Rust"` blocks from the late HIR pass in `rustc_passes` to attribute finalization. The check belongs to attribute validation, but it previously had to wait until HIR because the attribute parser did not know the foreign module's ABI. Instead of storing additional state in the parser or HIR, this change passes the ABI as local context for the current item. The authoritative ABI lowering remains unchanged, including invalid-ABI diagnostics, target validation, and feature gates. This preserves the existing lint behavior while removing the separate HIR-side check. Regression tests cover the relevant ABI cases, lint levels, multiple `#[link]` attributes, and invalid-ABI recovery.
…=folkertdev regression test for inherent associated const ICE Closes rust-lang#142722
Yeet `propagate_ambiguity` Fixes rust-lang/project-assumptions-on-binders#29 When assumptions computation fails, we want to force the goal response to be ambiguous since we can't evaluate placeholder constraints. We used to do this via `LeafRegionConstraint::Ambiguity` and propagates it everywhere. This PR simplifies that by tracking whether we should force ambiguity in a more direct way. We just check whether we have computed assumptions for relevant universes. This also clarifies the meaning of `LeafRegionConstraint::Ambiguity` which only represents true ambiguity (forever ambiguity no matter inference progress). This doesn't solve the problem that we're being conservative about forcing ambiguity. Maybe we can have `false`s in some universes even if other universes don't have assumptions. We can be smart about this in the future. Unsure part: we can also have ambiguity from non-lifetime placeholder. Unsure what to do with that. Still trying to understand it. r? @BoxyUwU
Ensure llvm worker threads have sufficient stack space The rustc driver sets the default stack size to 16MB, however worker threads spawned by the backend will use std's default stack size (usually 2MB). Pass through the stack size chosen by the driver to the backend, and explicitly request the stack size. This probably isn't the preferred way to do this, but maybe a starting point to educate me. This doesn't catch every spawned thread (jobserver and ctrlc also create them through std). Are there other threads which might be sensitive to small stack sizes? Fixes rust-lang#163272
…-obk Remove `PartialOrd`/`Ord` impls for `Span`/`SpanData` Because they are inconsistent with the `PartialEq`/`Eq` impls, and span ordering is inherently dubious. Details in individual commits. r? @oli-obk
…e, r=jieyouxu triagebot: Subscribe me to changes in test-float-parse
|
@bors r+ p=5 force |
This comment has been minimized.
This comment has been minimized.
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 51c768a (parent) -> 77027b6 (this PR) Test differencesShow 28 test diffsStage 1
Stage 2
Additionally, 16 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 77027b64d82d1e92f9ce2ea9042081c4567f5524 --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 |
|
Finished benchmarking commit (77027b6): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -1.5%, secondary 3.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 3.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary -0.0%, secondary -0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 488.57s -> 490.938s (0.48%) |
|
📌 Perf builds for each rolled up PR:
parent commit: 51c768aa5c In the case of a perf regression, run the following command with the SHAs of each PR you suspect might be the cause: |
|
@rust-timer triage all |
Running triage with 8 benchmarksTriage only executes the benchmarks on rollup members, that were changed significantly on the rollup.
#162915 1cb7ee0 Fix maximum
|
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
- | - | 0 |
| Regressions ❌ (secondary) |
- | - | 0 |
| Improvements ✅ (primary) |
- | - | 0 |
| Improvements ✅ (secondary) |
-0.5% | [-0.5%, -0.5%] | 1 |
| All ❌✅ (primary) | - | - | 0 |
Max RSS (memory usage)
Results (secondary -1.5%)
A less reliable metric. May be of interest, but not used to determine the overall result above.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
- | - | 0 |
| Regressions ❌ (secondary) |
- | - | 0 |
| Improvements ✅ (primary) |
- | - | 0 |
| Improvements ✅ (secondary) |
-1.5% | [-1.5%, -1.5%] | 1 |
| All ❌✅ (primary) | - | - | 0 |
Cycles
This perf run didn't have relevant results for this metric.
Binary size
This perf run didn't have relevant results for this metric.
#162917 7c14a12 fix ice for unresolved inherent delegation
This perf run didn't have relevant results for the `instruction count` metric.
Instruction count
This perf run didn't have relevant results for this metric.
Max RSS (memory usage)
This perf run didn't have relevant results for this metric.
Cycles
This perf run didn't have relevant results for this metric.
Binary size
This perf run didn't have relevant results for this metric.
#163209 8768ef7 x perf takes database path
This perf run didn't have relevant results for the `instruction count` metric.
Instruction count
This perf run didn't have relevant results for this metric.
Max RSS (memory usage)
This perf run didn't have relevant results for this metric.
Cycles
This perf run didn't have relevant results for this metric.
Binary size
This perf run didn't have relevant results for this metric.
#162373 4a60d69 Move the foreign module #[link] ABI check to attribute parsing
This perf run didn't have relevant results for the `instruction count` metric.
Instruction count
This perf run didn't have relevant results for this metric.
Max RSS (memory usage)
This perf run didn't have relevant results for this metric.
Cycles
This perf run didn't have relevant results for this metric.
Binary size
This perf run didn't have relevant results for this metric.
#162829 277d03f regression test for inherent associated const ICE
Instruction count
Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
- | - | 0 |
| Regressions ❌ (secondary) |
- | - | 0 |
| Improvements ✅ (primary) |
- | - | 0 |
| Improvements ✅ (secondary) |
-0.5% | [-0.5%, -0.5%] | 1 |
| All ❌✅ (primary) | - | - | 0 |
Max RSS (memory usage)
This perf run didn't have relevant results for this metric.
Cycles
This perf run didn't have relevant results for this metric.
Binary size
This perf run didn't have relevant results for this metric.
#162935 2be20bd Yeet propagate_ambiguity
Instruction count
Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
- | - | 0 |
| Regressions ❌ (secondary) |
- | - | 0 |
| Improvements ✅ (primary) |
- | - | 0 |
| Improvements ✅ (secondary) |
-0.3% | [-0.7%, -0.1%] | 19 |
| All ❌✅ (primary) | - | - | 0 |
Max RSS (memory usage)
This perf run didn't have relevant results for this metric.
Cycles
Results (secondary -4.0%)
A less reliable metric. May be of interest, but not used to determine the overall result above.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
- | - | 0 |
| Regressions ❌ (secondary) |
- | - | 0 |
| Improvements ✅ (primary) |
- | - | 0 |
| Improvements ✅ (secondary) |
-4.0% | [-4.0%, -4.0%] | 1 |
| All ❌✅ (primary) | - | - | 0 |
Binary size
This perf run didn't have relevant results for this metric.
#163289 37cab56 Ensure llvm worker threads have sufficient stack space
Instruction count
Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
- | - | 0 |
| Regressions ❌ (secondary) |
- | - | 0 |
| Improvements ✅ (primary) |
- | - | 0 |
| Improvements ✅ (secondary) |
-0.5% | [-0.5%, -0.5%] | 1 |
| All ❌✅ (primary) | - | - | 0 |
Max RSS (memory usage)
This perf run didn't have relevant results for this metric.
Cycles
This perf run didn't have relevant results for this metric.
Binary size
This perf run didn't have relevant results for this metric.
#163303 e5b91a3 Remove PartialOrd/Ord impls for Span/SpanData
Instruction count
Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
- | - | 0 |
| Regressions ❌ (secondary) |
- | - | 0 |
| Improvements ✅ (primary) |
- | - | 0 |
| Improvements ✅ (secondary) |
-0.5% | [-0.5%, -0.5%] | 1 |
| All ❌✅ (primary) | - | - | 0 |
Max RSS (memory usage)
This perf run didn't have relevant results for this metric.
Cycles
This perf run didn't have relevant results for this metric.
Binary size
This perf run didn't have relevant results for this metric.
#163421 9162f77 triagebot: Subscribe me to changes in test-float-parse
Instruction count
Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
| mean | range | count | |
|---|---|---|---|
| Regressions ❌ (primary) |
- | - | 0 |
| Regressions ❌ (secondary) |
- | - | 0 |
| Improvements ✅ (primary) |
- | - | 0 |
| Improvements ✅ (secondary) |
-0.5% | [-0.5%, -0.5%] | 1 |
| All ❌✅ (primary) | - | - | 0 |
Max RSS (memory usage)
This perf run didn't have relevant results for this metric.
Cycles
This perf run didn't have relevant results for this metric.
Binary size
This perf run didn't have relevant results for this metric.
Successful merges:
sendlength on non-{Mac, Windows} platforms #162915 (Fix maximumsendlength on non-{Mac, Windows} platforms)propagate_ambiguity#162935 (Yeetpropagate_ambiguity)PartialOrd/Ordimpls forSpan/SpanData#163303 (RemovePartialOrd/Ordimpls forSpan/SpanData)r? @ghost
Create a similar rollup