Skip to content

Conversation

@lcnr
Copy link
Contributor

@lcnr lcnr commented Nov 11, 2025

@rustbot
Copy link
Collaborator

rustbot commented Nov 11, 2025

changes to the core type system

cc @compiler-errors, @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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Nov 11, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 11, 2025

BoxyUwU is currently at their maximum review capacity.
They may take a while to respond.

@lcnr
Copy link
Contributor Author

lcnr commented Nov 11, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Nov 11, 2025
TypeRelating emit WellFormed, not generalize
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 11, 2025
@rust-bors
Copy link

rust-bors bot commented Nov 11, 2025

☀️ Try build successful (CI)
Build commit: 20a081a (20a081aa36c390f34fa701ef245698110b60e282, parent: 9312cd6d38396a13a08be73bb589fb1cf3dd32e6)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (20a081a): 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)
2.3% [2.0%, 2.8%] 6
Regressions ❌
(secondary)
5.7% [0.1%, 15.2%] 6
Improvements ✅
(primary)
-1.3% [-1.3%, -1.3%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.8% [-1.3%, 2.8%] 7

Max RSS (memory usage)

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

Cycles

Results (primary 2.3%, secondary 10.1%)

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

mean range count
Regressions ❌
(primary)
2.3% [2.2%, 2.5%] 3
Regressions ❌
(secondary)
10.1% [2.6%, 14.9%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.3% [2.2%, 2.5%] 3

Binary size

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

Bootstrap: 477.625s -> 479.621s (0.42%)
Artifact size: 391.41 MiB -> 391.37 MiB (-0.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Nov 11, 2025
@lcnr lcnr force-pushed the generalize-no-subtyping branch from aafb23b to 3bc3788 Compare November 12, 2025 10:57
@lcnr
Copy link
Contributor Author

lcnr commented Nov 12, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Nov 12, 2025
TypeRelating emit WellFormed, not generalize
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 12, 2025
@lcnr lcnr force-pushed the generalize-no-subtyping branch 2 times, most recently from 84fb939 to 282f7fe Compare November 12, 2025 11:35
@rustbot

This comment has been minimized.

@lcnr lcnr force-pushed the generalize-no-subtyping branch from 282f7fe to 929f6e2 Compare November 12, 2025 11:36
@rust-bors
Copy link

rust-bors bot commented Nov 12, 2025

☀️ Try build successful (CI)
Build commit: 3d1dd7d (3d1dd7d76f85165ff58987a09d383f7d3e8fbb59, parent: 95aeb4696545eb4c9cbb68516f2912770e3846ea)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (3d1dd7d): 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)
4.0% [3.4%, 4.8%] 6
Regressions ❌
(secondary)
10.3% [1.4%, 26.9%] 6
Improvements ✅
(primary)
-0.7% [-1.4%, -0.0%] 2
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.2%] 6
All ❌✅ (primary) 2.8% [-1.4%, 4.8%] 8

Max RSS (memory usage)

Results (primary 1.5%, secondary 0.4%)

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

mean range count
Regressions ❌
(primary)
1.5% [1.5%, 1.5%] 1
Regressions ❌
(secondary)
1.8% [1.5%, 2.0%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.3% [-2.3%, -2.3%] 1
All ❌✅ (primary) 1.5% [1.5%, 1.5%] 1

Cycles

Results (primary 2.8%, secondary 3.6%)

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

mean range count
Regressions ❌
(primary)
2.8% [2.6%, 3.1%] 3
Regressions ❌
(secondary)
9.6% [3.3%, 23.4%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.4% [-3.1%, -1.8%] 6
All ❌✅ (primary) 2.8% [2.6%, 3.1%] 3

Binary size

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

Bootstrap: 474.976s -> 475.327s (0.07%)
Artifact size: 391.06 MiB -> 391.12 MiB (0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 12, 2025
@lcnr lcnr force-pushed the generalize-no-subtyping branch from 929f6e2 to c137984 Compare November 13, 2025 09:35
@rustbot
Copy link
Collaborator

rustbot commented Nov 13, 2025

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@lcnr
Copy link
Contributor Author

lcnr commented Nov 13, 2025

@bors try @rust-timer queue

let's try to get the addition of combine_ty_args to be perf neutral. I didn't really expect this to have a large perf impact for any reasonable code

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Nov 13, 2025
TypeRelating emit WellFormed, not generalize
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 13, 2025
@rust-bors
Copy link

rust-bors bot commented Nov 13, 2025

☀️ Try build successful (CI)
Build commit: c68c666 (c68c666b8da09235a6e7c2bb7df932e791eb9b19, parent: 5dbf4069dc98bbbca98dd600a65f50c258fbfd56)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c68c666): comparison URL.

Overall result: ✅ improvements - 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

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.6% [-2.9%, -0.1%] 8
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.3%] 6
All ❌✅ (primary) -0.6% [-2.9%, -0.1%] 8

Max RSS (memory usage)

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

Cycles

Results (primary -2.9%)

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

Binary size

Results (primary -1.1%)

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

Bootstrap: 474.258s -> 474.449s (0.04%)
Artifact size: 388.39 MiB -> 388.41 MiB (0.01%)

@rustbot rustbot removed perf-regression Performance regression. S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Nov 13, 2025
@lcnr lcnr force-pushed the generalize-no-subtyping branch from c137984 to 1e593fd Compare November 13, 2025 15:18
@lcnr
Copy link
Contributor Author

lcnr commented Nov 13, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Nov 13, 2025
TypeRelating emit WellFormed, not generalize
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 13, 2025
@rust-bors
Copy link

rust-bors bot commented Nov 13, 2025

☀️ Try build successful (CI)
Build commit: 898f13c (898f13cd81a0ddff99ba0cc248c43c60d4738716, parent: d682af88a57b0045f8348507682c16c6160b522d)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (898f13c): comparison URL.

Overall result: ✅ improvements - 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

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.2% [0.2%, 0.2%] 1
Improvements ✅
(primary)
-0.5% [-1.3%, -0.1%] 3
Improvements ✅
(secondary)
-0.8% [-1.4%, -0.2%] 12
All ❌✅ (primary) -0.5% [-1.3%, -0.1%] 3

Max RSS (memory usage)

Results (primary 1.9%)

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

mean range count
Regressions ❌
(primary)
4.6% [4.6%, 4.6%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.8% [-0.8%, -0.8%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.9% [-0.8%, 4.6%] 2

Cycles

Results (secondary 3.7%)

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)
3.7% [2.1%, 4.8%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 472.838s -> 476.429s (0.76%)
Artifact size: 388.40 MiB -> 388.47 MiB (0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 13, 2025
Comment on lines -9 to -12
|
= note: requirement occurs because of the type `S<dyn Cat<'_>>`, which makes the generic argument `dyn Cat<'_>` invariant
= note: the struct `S<T>` is invariant over the parameter `T`
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
Copy link
Member

Choose a reason for hiding this comment

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

is the perf win we get from making this diagnostic worse, necessary to land this PR? I don't like this diagnostic change and think it was signfiicantly better before. Variance is subtle and it seems quite valuable to me to be explicitly telling people that they have lifetime issues due to variance

Copy link
Contributor Author

@lcnr lcnr Nov 17, 2025

Choose a reason for hiding this comment

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

This diagnostics change is 1e593fd and imo the current diagnostic relies on a bug. If we're already in an invariant context, the fact that S is invariant over T doesn't matter.

I do still need to add tests for the fixed next-solver behavior before merging this PR regardless.

@BoxyUwU BoxyUwU 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-review Status: Awaiting review from the assignee but also interested parties. labels Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

subtype obligations drop nested WF obligations required due to bivariant args

4 participants