Skip to content

Expand free alias types during variance computation#141030

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
fmease:lta-no-variance
Jun 11, 2026
Merged

Expand free alias types during variance computation#141030
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
fmease:lta-no-variance

Conversation

@fmease

@fmease fmease commented May 15, 2025

Copy link
Copy Markdown
Member

View all comments

Instead of computing variances for them since they can never be rigid anyway.

Fixes #140230.

@fmease fmease added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-types Relevant to the types team, which will review and decide on the PR/issue. F-lazy_type_alias `#![feature(lazy_type_alias)]` rla-silenced Silences rust-log-analyzer postings to the PR it's added on. labels May 15, 2025
@fmease fmease moved this to In Progress in Lazy Type Aliases (LTA) May 15, 2025
@fmease

fmease commented May 15, 2025

Copy link
Copy Markdown
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 15, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request May 15, 2025
[WIP] Expand free alias types during variance computation

Instead of computing variances for them since they can never be rigid anyway.

Fixes rust-lang#140230.
@bors

bors commented May 15, 2025

Copy link
Copy Markdown
Collaborator

⌛ Trying commit 1c11869 with merge 1b77fcd...

@bors

bors commented May 15, 2025

Copy link
Copy Markdown
Collaborator

☀️ Try build successful - checks-actions
Build commit: 1b77fcd (1b77fcd0847b6d6dcac3b0857fc0acc504e9f357)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (1b77fcd): comparison URL.

Overall result: ❌ regressions - please read the text below

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

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

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
1.1% [1.1%, 1.1%] 1
Regressions ❌
(secondary)
0.7% [0.7%, 0.7%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.1% [1.1%, 1.1%] 1

Max RSS (memory usage)

Results (primary 3.2%, secondary 5.0%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.2% [0.5%, 9.0%] 4
Regressions ❌
(secondary)
5.0% [4.6%, 5.4%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.2% [0.5%, 9.0%] 4

Cycles

Results (primary -0.8%, secondary -10.5%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.8% [-0.8%, -0.8%] 1
Improvements ✅
(secondary)
-10.5% [-14.0%, -2.6%] 7
All ❌✅ (primary) -0.8% [-0.8%, -0.8%] 1

Binary size

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

Bootstrap: 773.561s -> 773.719s (0.02%)
Artifact size: 365.44 MiB -> 365.31 MiB (-0.04%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels May 15, 2025
@BoxyUwU BoxyUwU self-assigned this May 27, 2025
@fmease fmease force-pushed the lta-no-variance branch from 1c11869 to 9429c14 Compare July 10, 2025 15:38
@fmease

fmease commented Jul 10, 2025

Copy link
Copy Markdown
Member Author

@bors2 try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

rust-bors Bot commented Jul 10, 2025

Copy link
Copy Markdown
Contributor

⌛ Trying commit 9429c14 with merge f04a108

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
[WIP] Expand free alias types during variance computation

Instead of computing variances for them since they can never be rigid anyway.

Fixes #140230.
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 10, 2025
@rust-bors

rust-bors Bot commented Jul 10, 2025

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: f04a108 (f04a1083ef0335f753c2d52583e8cc33a34e95fb, parent: 119574f83576dc1f3ae067f9a97986d4e2b0826c)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (f04a108): 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 -1.5%, secondary 1.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)
4.6% [3.1%, 6.1%] 2
Improvements ✅
(primary)
-1.5% [-1.5%, -1.5%] 1
Improvements ✅
(secondary)
-5.0% [-5.0%, -5.0%] 1
All ❌✅ (primary) -1.5% [-1.5%, -1.5%] 1

Cycles

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

Binary size

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

Bootstrap: 463.013s -> 463.287s (0.06%)
Artifact size: 374.51 MiB -> 374.53 MiB (0.01%)

@rustbot rustbot removed S-waiting-on-perf Status: Waiting on a perf run to be completed. perf-regression Performance regression. labels Jul 10, 2025
@rust-bors

This comment has been minimized.

@fmease fmease force-pushed the lta-no-variance branch from ad12b6b to 44ded41 Compare June 10, 2026 08:33
@rustbot

rustbot commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

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.

@fmease

fmease commented Jun 10, 2026

Copy link
Copy Markdown
Member Author

#141030 (comment)

addressed @rustbot review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 10, 2026
@fmease fmease force-pushed the lta-no-variance branch 2 times, most recently from 4d816d1 to b9ec2eb Compare June 10, 2026 10:01
@fmease fmease force-pushed the lta-no-variance branch from b9ec2eb to 05aee18 Compare June 10, 2026 10:05
jhpratt added a commit to jhpratt/rust that referenced this pull request Jun 10, 2026
Add more tests that exercise the well-formedness checking of lazy type aliases

Split out of PR rust-lang#141030. No behavioral changes.
@BoxyUwU

BoxyUwU commented Jun 11, 2026

Copy link
Copy Markdown
Member

@bors r+

thanks fmease :) good stuff

@rust-bors

rust-bors Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 05aee18 has been approved by BoxyUwU

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 Jun 11, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Jun 11, 2026
Expand free alias types during variance computation

Instead of computing variances for them since they can never be rigid anyway.

Fixes rust-lang#140230.
jhpratt added a commit to jhpratt/rust that referenced this pull request Jun 11, 2026
Expand free alias types during variance computation

Instead of computing variances for them since they can never be rigid anyway.

Fixes rust-lang#140230.
jhpratt added a commit to jhpratt/rust that referenced this pull request Jun 11, 2026
Expand free alias types during variance computation

Instead of computing variances for them since they can never be rigid anyway.

Fixes rust-lang#140230.
jhpratt added a commit to jhpratt/rust that referenced this pull request Jun 11, 2026
Expand free alias types during variance computation

Instead of computing variances for them since they can never be rigid anyway.

Fixes rust-lang#140230.
rust-bors Bot pushed a commit that referenced this pull request Jun 11, 2026
Rollup of 31 pull requests

Successful merges:

 - #141030 (Expand free alias types during variance computation)
 - #154853 (mgca: Register `ConstArgHasType` when normalizing projection consts)
 - #155527 (Replace printables table with `unicode_data.rs` tables)
 - #156629 (Stabilize `core::range::{legacy, RangeFull, RangeTo}`)
 - #157280 (traits: Allow escaping self types in ExistentialTraitRef::with_self_ty)
 - #157282 (Fix post-monomorphization error note race in the parallel frontend)
 - #157352 (Make the retained dep graph deterministic under the parallel frontend)
 - #157601 (Emit error for unused target expression in glob and list delegations)
 - #157611 (Update `browser-ui-test` version to `0.24.0`)
 - #157620 (Add a strategy FnMut to inject behavior into the flush cycle)
 - #157645 (Windows TLS - Only register the `atexit` hook when `cleanup` can be unloaded)
 - #157646 (Keep rename-imported main alive in dead-code analysis under `--test`)
 - #157647 (Start using comptime for reflection intrinsics and their wrapper functions)
 - #157719 (resolve: Partially revert "Remove a special case for dummy imports")
 - #155153 (Ensure Send/Sync is not implemented for std::env::Vars{,Os})
 - #155198 (fix(mgca): Allow specifying generic args (of enum) on enum itself in unit & tuple variant constructions in (direct) const args)
 - #155323 (refactor `TypeRelativePath::AssocItem` to use `AliasTerm`)
 - #156497 (fix-155516: Don't suggest wrong unwrap expect)
 - #156583 (Support defaults for static EIIs)
 - #157013 (Ensure inferred let pattern types are well-formed)
 - #157196 (Only suggest reborrowing a moved value where the reborrow is valid)
 - #157230 (borrowck: avoid ICE describing fields on generic params)
 - #157288 (platform support: add SNaN erratum to MIPS targets)
 - #157330 (remove `IsTypeConst` from `hir::TraitItemKind`)
 - #157350 (compiletest: ignore SVG `y` offset in by-lines comparison)
 - #157355 (Add `or_try_*` variants for `HashMap` and `BTreeMap` Entry APIs)
 - #157577 (Fix parser error recovery treating 'dyn' as a strict keyword in Rust 2015 when used in `dyn + dyn`)
 - #157670 (Rename `errors.rs` file to `diagnostics.rs` (4/N))
 - #157691 (Move symbol hiding code to a new file)
 - #157700 (Rename `errors.rs` file to `diagnostics.rs` (5/N))
 - #157703 (Fix doc link to Instant sub in saturating caveat)

Failed merges:

 - #157699 (Arg splat experiment - hir FnDecl impl)
@rust-bors rust-bors Bot merged commit 0f54478 into rust-lang:main Jun 11, 2026
12 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Lazy Type Aliases (LTA) Jun 11, 2026
@rustbot rustbot added this to the 1.98.0 milestone Jun 11, 2026
@fmease fmease deleted the lta-no-variance branch June 11, 2026 11:24
rust-timer added a commit that referenced this pull request Jun 11, 2026
Rollup merge of #141030 - fmease:lta-no-variance, r=BoxyUwU

Expand free alias types during variance computation

Instead of computing variances for them since they can never be rigid anyway.

Fixes #140230.
LaneAsade pushed a commit to LaneAsade/rust that referenced this pull request Jun 11, 2026
Rollup of 31 pull requests

Successful merges:

 - rust-lang#141030 (Expand free alias types during variance computation)
 - rust-lang#154853 (mgca: Register `ConstArgHasType` when normalizing projection consts)
 - rust-lang#155527 (Replace printables table with `unicode_data.rs` tables)
 - rust-lang#156629 (Stabilize `core::range::{legacy, RangeFull, RangeTo}`)
 - rust-lang#157280 (traits: Allow escaping self types in ExistentialTraitRef::with_self_ty)
 - rust-lang#157282 (Fix post-monomorphization error note race in the parallel frontend)
 - rust-lang#157352 (Make the retained dep graph deterministic under the parallel frontend)
 - rust-lang#157601 (Emit error for unused target expression in glob and list delegations)
 - rust-lang#157611 (Update `browser-ui-test` version to `0.24.0`)
 - rust-lang#157620 (Add a strategy FnMut to inject behavior into the flush cycle)
 - rust-lang#157645 (Windows TLS - Only register the `atexit` hook when `cleanup` can be unloaded)
 - rust-lang#157646 (Keep rename-imported main alive in dead-code analysis under `--test`)
 - rust-lang#157647 (Start using comptime for reflection intrinsics and their wrapper functions)
 - rust-lang#157719 (resolve: Partially revert "Remove a special case for dummy imports")
 - rust-lang#155153 (Ensure Send/Sync is not implemented for std::env::Vars{,Os})
 - rust-lang#155198 (fix(mgca): Allow specifying generic args (of enum) on enum itself in unit & tuple variant constructions in (direct) const args)
 - rust-lang#155323 (refactor `TypeRelativePath::AssocItem` to use `AliasTerm`)
 - rust-lang#156497 (fix-155516: Don't suggest wrong unwrap expect)
 - rust-lang#156583 (Support defaults for static EIIs)
 - rust-lang#157013 (Ensure inferred let pattern types are well-formed)
 - rust-lang#157196 (Only suggest reborrowing a moved value where the reborrow is valid)
 - rust-lang#157230 (borrowck: avoid ICE describing fields on generic params)
 - rust-lang#157288 (platform support: add SNaN erratum to MIPS targets)
 - rust-lang#157330 (remove `IsTypeConst` from `hir::TraitItemKind`)
 - rust-lang#157350 (compiletest: ignore SVG `y` offset in by-lines comparison)
 - rust-lang#157355 (Add `or_try_*` variants for `HashMap` and `BTreeMap` Entry APIs)
 - rust-lang#157577 (Fix parser error recovery treating 'dyn' as a strict keyword in Rust 2015 when used in `dyn + dyn`)
 - rust-lang#157670 (Rename `errors.rs` file to `diagnostics.rs` (4/N))
 - rust-lang#157691 (Move symbol hiding code to a new file)
 - rust-lang#157700 (Rename `errors.rs` file to `diagnostics.rs` (5/N))
 - rust-lang#157703 (Fix doc link to Instant sub in saturating caveat)

Failed merges:

 - rust-lang#157699 (Arg splat experiment - hir FnDecl impl)
LaneAsade pushed a commit to LaneAsade/rust that referenced this pull request Jun 11, 2026
Rollup of 31 pull requests

Successful merges:

 - rust-lang#141030 (Expand free alias types during variance computation)
 - rust-lang#154853 (mgca: Register `ConstArgHasType` when normalizing projection consts)
 - rust-lang#155527 (Replace printables table with `unicode_data.rs` tables)
 - rust-lang#156629 (Stabilize `core::range::{legacy, RangeFull, RangeTo}`)
 - rust-lang#157280 (traits: Allow escaping self types in ExistentialTraitRef::with_self_ty)
 - rust-lang#157282 (Fix post-monomorphization error note race in the parallel frontend)
 - rust-lang#157352 (Make the retained dep graph deterministic under the parallel frontend)
 - rust-lang#157601 (Emit error for unused target expression in glob and list delegations)
 - rust-lang#157611 (Update `browser-ui-test` version to `0.24.0`)
 - rust-lang#157620 (Add a strategy FnMut to inject behavior into the flush cycle)
 - rust-lang#157645 (Windows TLS - Only register the `atexit` hook when `cleanup` can be unloaded)
 - rust-lang#157646 (Keep rename-imported main alive in dead-code analysis under `--test`)
 - rust-lang#157647 (Start using comptime for reflection intrinsics and their wrapper functions)
 - rust-lang#157719 (resolve: Partially revert "Remove a special case for dummy imports")
 - rust-lang#155153 (Ensure Send/Sync is not implemented for std::env::Vars{,Os})
 - rust-lang#155198 (fix(mgca): Allow specifying generic args (of enum) on enum itself in unit & tuple variant constructions in (direct) const args)
 - rust-lang#155323 (refactor `TypeRelativePath::AssocItem` to use `AliasTerm`)
 - rust-lang#156497 (fix-155516: Don't suggest wrong unwrap expect)
 - rust-lang#156583 (Support defaults for static EIIs)
 - rust-lang#157013 (Ensure inferred let pattern types are well-formed)
 - rust-lang#157196 (Only suggest reborrowing a moved value where the reborrow is valid)
 - rust-lang#157230 (borrowck: avoid ICE describing fields on generic params)
 - rust-lang#157288 (platform support: add SNaN erratum to MIPS targets)
 - rust-lang#157330 (remove `IsTypeConst` from `hir::TraitItemKind`)
 - rust-lang#157350 (compiletest: ignore SVG `y` offset in by-lines comparison)
 - rust-lang#157355 (Add `or_try_*` variants for `HashMap` and `BTreeMap` Entry APIs)
 - rust-lang#157577 (Fix parser error recovery treating 'dyn' as a strict keyword in Rust 2015 when used in `dyn + dyn`)
 - rust-lang#157670 (Rename `errors.rs` file to `diagnostics.rs` (4/N))
 - rust-lang#157691 (Move symbol hiding code to a new file)
 - rust-lang#157700 (Rename `errors.rs` file to `diagnostics.rs` (5/N))
 - rust-lang#157703 (Fix doc link to Instant sub in saturating caveat)

Failed merges:

 - rust-lang#157699 (Arg splat experiment - hir FnDecl impl)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-lazy_type_alias `#![feature(lazy_type_alias)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-types Relevant to the types team, which will review and decide on the PR/issue.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Free type aliases should not require all generic parameters to be used

5 participants