Skip to content

Instantiate auto trait/Copy/Clone/Sized before computing constituent types binder #143538

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 3 commits into
base: master
Choose a base branch
from

Conversation

compiler-errors
Copy link
Member

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

This makes the binder logic w.r.t. coroutines a bit simpler.

r? lcnr

@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. labels Jul 6, 2025
@compiler-errors
Copy link
Member Author

@bors2 try @rust-timer queue

and needs crater too when that's done

@rust-timer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Jul 6, 2025

⌛ Trying commit 41eb6d8 with merge ad95a52

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
Instantiate auto trait before computing higher-ranked constituent types

This will need an FCP and a crater run, but I think this makes the binder logic w.r.t. auto traits and coroutines a bit simpler.

r? lcnr
@compiler-errors compiler-errors added the needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. label Jul 6, 2025
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 6, 2025
@compiler-errors compiler-errors added T-types Relevant to the types team, which will review and decide on the PR/issue. and removed T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 6, 2025
@rust-bors
Copy link

rust-bors bot commented Jul 6, 2025

☀️ Try build successful (CI)
Build commit: ad95a52 (ad95a52e03621d91078ef94a829abc288aed9fb5, parent: de031bbcb161b0b7fc0eb16f77b02ce9fbdf4c9e)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ad95a52): comparison URL.

Overall result: no relevant changes - no action needed

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.

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

Instruction count

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

Max RSS (memory usage)

Results (primary -2.4%)

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)
-2.4% [-2.4%, -2.4%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.4% [-2.4%, -2.4%] 1

Cycles

Results (secondary -4.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)
-4.5% [-4.5%, -4.5%] 1
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 460.528s -> 461.621s (0.24%)
Artifact size: 372.13 MiB -> 372.18 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 7, 2025
@lcnr
Copy link
Contributor

lcnr commented Jul 7, 2025

why does this need an FCP? we enter the merged binders right after calling constituent_types_for_ty and whether we've got placeholders from 2 different universes shouldn't matter 🤔 it would only matter if there was a way to create infer vars which can only name some of the placeholders, this shouldn't happen

We always instantiate the binder after calling copy_clone_conditions as well.

@compiler-errors compiler-errors removed the needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. label Jul 7, 2025
@compiler-errors compiler-errors force-pushed the instantiate-auto-trait branch from 41eb6d8 to 9cb805e Compare July 7, 2025 22:21
@compiler-errors
Copy link
Member Author

Yeah, I don't see why this has an FCP. Was just being a bit conservative, but there's no observable behavioral change here that I can see.

@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 7, 2025

⌛ Trying commit 9cb805e with merge 18fd892

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

rust-bors bot added a commit that referenced this pull request Jul 7, 2025
Instantiate auto trait before computing higher-ranked constituent types

This makes the binder logic w.r.t. auto traits and coroutines a bit simpler.

r? lcnr
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 7, 2025
@rust-bors
Copy link

rust-bors bot commented Jul 8, 2025

☀️ Try build successful (CI)
Build commit: 18fd892 (18fd892b5bfc2ba679fb0c0af2b5b4f5fd09a6bb, parent: 2f8eeb2bba86b8f457ec602c578473c711f85628)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (18fd892): comparison URL.

Overall result: ❌ regressions - 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.2%, 0.2%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.2% [0.2%, 0.2%] 3

Max RSS (memory usage)

Results (secondary 2.2%)

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)
2.2% [2.2%, 2.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results (primary -0.8%, secondary 1.1%)

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)
4.8% [4.8%, 4.8%] 1
Improvements ✅
(primary)
-3.8% [-3.8%, -3.8%] 1
Improvements ✅
(secondary)
-2.7% [-2.7%, -2.7%] 1
All ❌✅ (primary) -0.8% [-3.8%, 2.2%] 2

Binary size

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

Bootstrap: 465.909s -> 464.854s (-0.23%)
Artifact size: 372.26 MiB -> 372.25 MiB (-0.00%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jul 8, 2025
@compiler-errors compiler-errors changed the title Instantiate auto trait before computing higher-ranked constituent types Instantiate auto trait/Copy/Clone/Sized before computing constituent types binder Jul 8, 2025
@compiler-errors
Copy link
Member Author

This is either noise or insignificant wrt the cleanup

@rustbot ready

@bors
Copy link
Collaborator

bors commented Jul 8, 2025

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

| ty::Str
| ty::Slice(..)
| ty::Foreign(..)
| ty::Ref(_, _, hir::Mutability::Mut) => {}
Copy link
Contributor

Choose a reason for hiding this comment

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

the comment is wrong for &mut _ 🤔

@lcnr
Copy link
Contributor

lcnr commented Jul 8, 2025

r=me after rebase + nit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-types Relevant to the types team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants