Skip to content

[experiment] Consider WF of coroutine witness when proving outlives assumptions #143545

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Jul 6, 2025

This needs to be majorly cleaned up


cc #110338

Consider, for example:

use std::future::Future;

trait Client {
    type Connecting<'a>: Future + Send
    where
        Self: 'a;
    fn connect(&'_ self) -> Self::Connecting<'_>;
}

fn call_connect<C>(c: &'_ C) -> impl Future + Send
where
    C: Client + Send + Sync,
{
    async move { c.connect().await }
}

@rustbot
Copy link
Collaborator

rustbot commented Jul 6, 2025

r? @spastorino

rustbot has assigned @spastorino.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Jul 6, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 6, 2025

Some changes occurred to the core trait solver

cc @rust-lang/initiative-trait-system-refactor

@compiler-errors
Copy link
Member Author

@bors2 try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Jul 6, 2025

⌛ Trying commit 9613c58 with merge c9e8f2f

To cancel the try build, run the command @bors2 try cancel.

rust-bors bot added a commit that referenced this pull request Jul 6, 2025
[experiment] Consider WF of coroutine witness when proving outlives assumptions

This needs to be majorly cleaned up

---

cc #110338

Consider, for example:

```rust
use std::future::Future;

trait Client {
    type Connecting<'a>: Future + Send
    where
        Self: 'a;
    fn connect(&'_ self) -> Self::Connecting<'_>;
}

fn call_connect<C>(c: &'_ C) -> impl Future + Send
where
    C: Client + Send + Sync,
{
    async move { c.connect().await }
}
```
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 6, 2025
@rust-log-analyzer

This comment has been minimized.

let region_assumptions = infcx.take_registered_region_assumptions();
let region_constraints = infcx.take_and_reset_region_constraints();
tcx.mk_outlives_from_iter(
make_query_region_constraints(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to eagerly resolve the assumptions here.

@rust-bors
Copy link

rust-bors bot commented Jul 7, 2025

☀️ Try build successful (CI)
Build commit: c9e8f2f (c9e8f2fc63f9e854f5dc2b7f8dbffc5523b3138d, parent: de031bbcb161b0b7fc0eb16f77b02ce9fbdf4c9e)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c9e8f2f): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

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.2% [0.1%, 0.5%] 57
Regressions ❌
(secondary)
0.2% [0.0%, 0.4%] 32
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.4% [-1.0%, -0.0%] 8
All ❌✅ (primary) 0.2% [0.1%, 0.5%] 57

Max RSS (memory usage)

Results (primary 1.1%, secondary -0.2%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.1% [0.7%, 1.7%] 3
Regressions ❌
(secondary)
2.6% [1.1%, 3.4%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-4.0% [-4.7%, -2.8%] 3
All ❌✅ (primary) 1.1% [0.7%, 1.7%] 3

Cycles

Results (primary 2.2%, secondary 0.7%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.2% [2.2%, 2.2%] 1
Regressions ❌
(secondary)
2.7% [2.1%, 3.0%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-5.4% [-5.6%, -5.3%] 2
All ❌✅ (primary) 2.2% [2.2%, 2.2%] 1

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 460.528s -> 463.281s (0.60%)
Artifact size: 372.13 MiB -> 371.71 MiB (-0.11%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jul 7, 2025
@bors
Copy link
Collaborator

bors commented Jul 9, 2025

☔ The latest upstream changes (presumably #143538) made this pull request unmergeable. Please resolve the merge conflicts.

@compiler-errors compiler-errors force-pushed the coroutine-obl branch 2 times, most recently from 69dda47 to a7ec91c Compare July 10, 2025 00:33
@compiler-errors
Copy link
Member Author

@bors2 try

@rust-bors
Copy link

rust-bors bot commented Jul 10, 2025

⌛ Trying commit a7ec91c with merge 3c75d58

To cancel the try build, run the command @bors2 try cancel.

rust-bors bot added a commit that referenced this pull request Jul 10, 2025
[experiment] Consider WF of coroutine witness when proving outlives assumptions

This needs to be majorly cleaned up

---

cc #110338

Consider, for example:

```rust
use std::future::Future;

trait Client {
    type Connecting<'a>: Future + Send
    where
        Self: 'a;
    fn connect(&'_ self) -> Self::Connecting<'_>;
}

fn call_connect<C>(c: &'_ C) -> impl Future + Send
where
    C: Client + Send + Sync,
{
    async move { c.connect().await }
}
```
@rust-bors
Copy link

rust-bors bot commented Jul 10, 2025

☀️ Try build successful (CI)
Build commit: 3c75d58 (3c75d5844aa65b4aa19243ac44ceda49fe4e61ca, parent: e43d139a82620a268d3828a73e12a8679339e8f8)

@compiler-errors
Copy link
Member Author

Don't expect this to fix any code, but I want to see whether it causes new issues.

@craterbot check

@craterbot
Copy link
Collaborator

👌 Experiment pr-143545 created and queued.
🤖 Automatically detected try build 3c75d58
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 10, 2025
@craterbot
Copy link
Collaborator

🚧 Experiment pr-143545 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🎉 Experiment pr-143545 is completed!
📊 6 regressed and 5 fixed (662328 total)
📰 Open the summary report.

⚠️ If you notice any spurious failure please add them to the denylist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Jul 11, 2025
@rustbot rustbot added A-tidy Area: The tidy tool T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Jul 13, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 13, 2025

There are changes to the tidy tool.

cc @jieyouxu

@compiler-errors
Copy link
Member Author

@bors2 try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

rust-bors bot added a commit that referenced this pull request Jul 14, 2025
[experiment] Consider WF of coroutine witness when proving outlives assumptions

This needs to be majorly cleaned up

---

cc #110338

Consider, for example:

```rust
use std::future::Future;

trait Client {
    type Connecting<'a>: Future + Send
    where
        Self: 'a;
    fn connect(&'_ self) -> Self::Connecting<'_>;
}

fn call_connect<C>(c: &'_ C) -> impl Future + Send
where
    C: Client + Send + Sync,
{
    async move { c.connect().await }
}
```
@rust-bors
Copy link

rust-bors bot commented Jul 14, 2025

⌛ Trying commit 6999485 with merge fd967a6

To cancel the try build, run the command @bors2 try cancel.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tidy Area: The tidy tool perf-regression Performance regression. S-waiting-on-perf Status: Waiting on a perf run to be completed. 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-compiler Relevant to the compiler team, which will review and decide on the PR/issue. 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