Skip to content

Rollup of 5 pull requests - #163437

Closed
JonathanBrouwer wants to merge 15 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-jZtOHfF
Closed

JonathanBrouwer wants to merge 15 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-jZtOHfF

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

nnethercote and others added 15 commits September 25, 2026 15:01
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.
`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` + `==`.
… 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.
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
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Sep 28, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Sep 28, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member Author

@bors r+ p=5 force

Trying commonly failed jobs
@bors try jobs=dist-various-1,test-various,test-x86_64-gnu-aux,test-x86_64-gnu-llvm-21-3,test-x86_64-msvc-1,test-aarch64-apple-1,test-aarch64-apple-2,test-x86_64-mingw-1,test-i686-msvc,test-armhf-gnu

@rust-bors

rust-bors Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 629cec2 has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 28, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 28, 2026
Rollup of 5 pull requests


try-job: dist-various-1
try-job: test-various
try-job: test-x86_64-gnu-aux
try-job: test-x86_64-gnu-llvm-21-3
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
@rust-bors

rust-bors Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

⌛ Testing commit 629cec2 with merge 4014019...

Workflow: https://github.com/rust-lang/rust/actions/runs/36420291458

rust-bors Bot pushed a commit that referenced this pull request Sep 28, 2026
…uwer

Rollup of 5 pull requests

Successful merges:

 - #162917 (fix ice for unresolved inherent delegation)
 - #163209 (x perf takes database path)
 - #162935 (Yeet `propagate_ambiguity`)
 - #163289 (Ensure llvm worker threads have sufficient stack space)
 - #163303 (Remove `PartialOrd`/`Ord` impls for `Span`/`SpanData`)
@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 28, 2026
@rust-bors

rust-bors Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved due to being closed.

Auto build was cancelled due to the PR being closed. Cancelled workflows:

@rust-bors

rust-bors Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 3ef2e1e (3ef2e1ef4a3cde1d9feabdf5f1ccc92ea3338279)
Base parent: 51c768a (51c768aa5cb99ae7670e97b0e8392f926e79855e)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants