Skip to content

Simplify and consolidate the way we handle construct OutlivesEnvironment for lexical region resolution #136038

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

Merged
merged 3 commits into from
Jan 30, 2025

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Jan 25, 2025

This is best reviewed commit-by-commit. I tried to consolidate the API for lexical region resolution first, then change the API when it was finally behind a single surface.

r? lcnr or reassign

@rustbot rustbot added A-rustc-dev-guide Area: rustc-dev-guide 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 Jan 25, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jan 25, 2025

Some changes occurred in engine.rs, potentially modifying the public API of ObligationCtxt.

cc @lcnr, @compiler-errors

The rustc-dev-guide subtree was changed. If this PR only touches the dev guide consider submitting a PR directly to rust-lang/rustc-dev-guide otherwise thank you for updating the dev guide with your changes.

cc @BoxyUwU, @jieyouxu, @Kobzol

@compiler-errors
Copy link
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 Jan 25, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 25, 2025
Simplify and consolidate the way we handle construct `OutlivesEnvironment` for lexical region resolution

... and also remove `region_bound_pairs` which is just totally redundant.

This is best reviewed commit-by-commit. I tried to consolidate the API for lexical region resolution *first*, then change the API when it was finally behind a single surface. Finally, I removed `region_bound_pairs` from borrowck + type outlives.

r? lcnr or reassign
@bors
Copy link
Collaborator

bors commented Jan 25, 2025

⌛ Testing commit 485c6f4 with merge 59a7fd4...

@compiler-errors
Copy link
Member Author

bors why

@bors r- retry

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 25, 2025
@compiler-errors
Copy link
Member Author

@bors try

@bors
Copy link
Collaborator

bors commented Jan 25, 2025

⌛ Trying commit 485c6f4 with merge 0aed6e1...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 25, 2025
Simplify and consolidate the way we handle construct `OutlivesEnvironment` for lexical region resolution

... and also remove `region_bound_pairs` which is just totally redundant.

This is best reviewed commit-by-commit. I tried to consolidate the API for lexical region resolution *first*, then change the API when it was finally behind a single surface. Finally, I removed `region_bound_pairs` from borrowck + type outlives.

r? lcnr or reassign
@@ -55,7 +55,7 @@ The assumed outlives constraints for implicit bounds are computed using the
MIR borrowck adds the outlives constraints for both the normalized and unnormalized types,
lexical region resolution [only uses the unnormalized types][notnorm].

[`fn OutlivesEnvironment::with_bounds`]: https://github.com/rust-lang/rust/blob/5b8bc568d28b2e922290c9a966b3231d0ce9398b/compiler/rustc_infer/src/infer/outlives/env.rs#L90-L97
[`fn OutlivesEnvironment::new`]: TODO
Copy link
Member Author

Choose a reason for hiding this comment

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

This is an interesting situation where I don't yet have a commit hash to put here until this is ready to land :>

Copy link
Member

@jieyouxu jieyouxu Jan 25, 2025

Choose a reason for hiding this comment

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

You could just put master instead of a commit hash for now

Copy link
Member

@matthiaskrgr matthiaskrgr Jan 25, 2025

Choose a reason for hiding this comment

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

@bors
Copy link
Collaborator

bors commented Jan 25, 2025

☀️ Try build successful - checks-actions
Build commit: 0aed6e1 (0aed6e184da0723e1d7a24c146a9f003ef43423f)

@rust-timer

This comment has been minimized.

@fmease fmease removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jan 25, 2025
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0aed6e1): 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.4% [0.5%, 2.9%] 13
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.4% [0.5%, 2.9%] 13

Max RSS (memory usage)

Results (primary 0.8%, secondary -2.9%)

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)
2.9% [2.7%, 3.2%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.4% [-3.6%, -1.2%] 2
Improvements ✅
(secondary)
-2.9% [-4.5%, -2.0%] 3
All ❌✅ (primary) 0.8% [-3.6%, 3.2%] 5

Cycles

Results (primary 1.1%)

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

Binary size

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

Bootstrap: 774.222s -> 771.853s (-0.31%)
Artifact size: 325.84 MiB -> 325.76 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 Jan 25, 2025
@compiler-errors
Copy link
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 Jan 25, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 25, 2025
Simplify and consolidate the way we handle construct `OutlivesEnvironment` for lexical region resolution

... and also remove `region_bound_pairs` which is just totally redundant.

This is best reviewed commit-by-commit. I tried to consolidate the API for lexical region resolution *first*, then change the API when it was finally behind a single surface. Finally, I removed `region_bound_pairs` from borrowck + type outlives.

r? lcnr or reassign
@compiler-errors
Copy link
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 Jan 25, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 25, 2025
Simplify and consolidate the way we handle construct `OutlivesEnvironment` for lexical region resolution

... and also remove `region_bound_pairs` which is just totally redundant.

This is best reviewed commit-by-commit. I tried to consolidate the API for lexical region resolution *first*, then change the API when it was finally behind a single surface. Finally, I removed `region_bound_pairs` from borrowck + type outlives.

r? lcnr or reassign
@bors
Copy link
Collaborator

bors commented Jan 25, 2025

⌛ Trying commit e883ffc with merge d9c2438...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Jan 25, 2025

☀️ Try build successful - checks-actions
Build commit: d9c2438 (d9c243839672c601314a48adc4fd49431a7cc383)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d9c2438): comparison URL.

Overall result: no relevant changes - no action needed

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.

@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 -0.2%)

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

Cycles

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

Binary size

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

Bootstrap: 771.158s -> 769.798s (-0.18%)
Artifact size: 325.82 MiB -> 325.79 MiB (-0.01%)

@rustbot rustbot removed S-waiting-on-perf Status: Waiting on a perf run to be completed. perf-regression Performance regression. labels Jan 26, 2025
@compiler-errors
Copy link
Member Author

@rustbot ready

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 26, 2025
@lcnr
Copy link
Contributor

lcnr commented Jan 28, 2025

r=me after removing the TODO

@compiler-errors
Copy link
Member Author

@bors r=lcnr

@bors
Copy link
Collaborator

bors commented Jan 29, 2025

📌 Commit 8e0909d has been approved by lcnr

It is now in the queue for this repository.

@bors bors 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 Jan 29, 2025
@bors
Copy link
Collaborator

bors commented Jan 30, 2025

⌛ Testing commit 8e0909d with merge 5a45ab9...

@bors
Copy link
Collaborator

bors commented Jan 30, 2025

☀️ Test successful - checks-actions
Approved by: lcnr
Pushing 5a45ab9 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 30, 2025
@bors bors merged commit 5a45ab9 into rust-lang:master Jan 30, 2025
7 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Jan 30, 2025
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5a45ab9): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

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

Max RSS (memory usage)

Results (primary 2.9%, secondary 1.9%)

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)
2.9% [2.1%, 3.8%] 2
Regressions ❌
(secondary)
1.9% [1.2%, 2.2%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.9% [2.1%, 3.8%] 2

Cycles

Results (secondary 1.9%)

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

Binary size

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

Bootstrap: 776.287s -> 778.535s (0.29%)
Artifact size: 328.44 MiB -> 328.51 MiB (0.02%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustc-dev-guide Area: rustc-dev-guide merged-by-bors This PR was explicitly merged by bors. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants