Skip to content

Abby: make lexical region resolution directly consume abby constraints - #164354

Draft
BoxyUwU wants to merge 1 commit into
rust-lang:mainfrom
BoxyUwU:abby_lexical_region_resolution
Draft

BoxyUwU wants to merge 1 commit into
rust-lang:mainfrom
BoxyUwU:abby_lexical_region_resolution

Conversation

@BoxyUwU

@BoxyUwU BoxyUwU commented Oct 15, 2026

Copy link
Copy Markdown
Member

r? khyperia
cc @lcnr

Previously we would convert abby constraints into legacy constraints and then lexical region resolution would just work with legacy constraints. This PR makes it so that lexical region resolution is able to directly consume abby constraints which will be necessary when we yeet legacy_data from RegionConstraintStorage.

This exposes some existing brokenness of abby, we currently accidentally register legacy type and region outlives constraints even when abby is enabled. Previously lexical region resolve would handle those constraints and now it doesn't since it only consumes abby constraints when abby is enabled.

This causes the GATs check that where Self: 'a is present on type Gat<'a>; to no longer work. This should get fixed as we make more progress on abby and stop registering legacy style constraints 😅 I intend to follow this PR up with another PR that does exactly that and prevents this kind of issue from occuring again.

Might be perf sensitive due to the addition of cloning a bunch of SubregionOrigins now.

@rustbot rustbot added 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. labels Oct 15, 2026
@BoxyUwU
BoxyUwU force-pushed the abby_lexical_region_resolution branch from 9271f42 to 7b4965e Compare October 15, 2026 11:53
Comment on lines +186 to +187
sub: r2,
sup: r1,

@BoxyUwU BoxyUwU Oct 15, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this does infact flip regions to be the wrong way round but that's lexical region resolution for you xd it just works the wrong way round ✨

Suggested change
sub: r2,
sup: r1,
// We intentionally flip the regions here as lexical region resolution is
// kinda scuffed and inverts the subtyping relations of regions from outlives relations
sub: r2,
sup: r1,

View changes since the review

@BoxyUwU

BoxyUwU commented Oct 15, 2026

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 Oct 15, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 15, 2026
Abby: make lexical region resolution directly consume abby constraints
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job test-pr-check-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
 Documenting rustc_expand v0.0.0 (/checkout/compiler/rustc_expand)
warning: unresolved link to `RegionConstraintData::constraints`
  --> compiler/rustc_infer/src/infer/lexical_region_resolve/indexed_edges.rs:15:42
   |
15 | /// Type alias for the pairs stored in [`RegionConstraintData::constraints`],
   |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `RegionConstraintData` in scope
   |
   = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default

 Documenting rustc_ast_passes v0.0.0 (/checkout/compiler/rustc_ast_passes)
 Documenting rustc_windows_rc v0.0.0 (/checkout/compiler/rustc_windows_rc)

@rust-bors

rust-bors Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 0f3844a (0f3844a2152e354f4ed41453b23aeae3f5f8a65d)
Base parent: 8a9dd7a (8a9dd7abdf013ec10cfeaaa3685feba18ef1c90c)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (0f3844a): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@bors rollup=never rustc-perf
@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.3%] 6
Regressions ❌
(secondary)
0.2% [0.1%, 0.4%] 18
Improvements ✅
(primary)
-0.7% [-0.7%, -0.7%] 1
Improvements ✅
(secondary)
-0.3% [-0.6%, -0.0%] 2
All ❌✅ (primary) 0.0% [-0.7%, 0.3%] 7

Max RSS (memory usage)

Results (primary -2.8%, 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)
3.6% [2.8%, 4.3%] 2
Improvements ✅
(primary)
-2.8% [-4.5%, -1.0%] 2
Improvements ✅
(secondary)
-2.9% [-2.9%, -2.9%] 1
All ❌✅ (primary) -2.8% [-4.5%, -1.0%] 2

Cycles

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

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 490.736s -> 488.64s (-0.43%)
Artifact size: 407.05 MiB -> 407.15 MiB (0.02%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Oct 15, 2026
@rust-bors

rust-bors Bot commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

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

This branch has not been deployed

No deployments
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-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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants