Skip to content

Conversation

@LorrensP-2158466
Copy link
Contributor

@LorrensP-2158466 LorrensP-2158466 commented Oct 31, 2025

Fixes #148289
Fixes #104477
Should unblock #148187

When propagating closure requirements we:

  • no longer try to find a post dominiting region for the list of non-local lower bounds of longer_fr.
  • we filter the list of longer_fr-: shorter_fr+ to only these constraints between external regions which are required regardless. If no such constraint exists, we fall back to propagating all of them.

See the FCP for more information.

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 Oct 31, 2025
@LorrensP-2158466 LorrensP-2158466 changed the title Do not propogate unnecessary closure constraints + tests. Do not propogate unnecessary closure constraints. Oct 31, 2025
@rust-log-analyzer

This comment has been minimized.

@rustbot
Copy link
Collaborator

rustbot commented Oct 31, 2025

Some changes occurred in src/tools/cargo

cc @ehuss

@rustbot

This comment has been minimized.

@LorrensP-2158466
Copy link
Contributor Author

LorrensP-2158466 commented Oct 31, 2025

Excuse me ehuss for the automatic ping, I was a bit too fast with pushing the typo fixes reported by the tidy job.

@lcnr
Copy link
Contributor

lcnr commented Nov 3, 2025

@bors try @rust-timer

let's do a crater run, even if I think it should be fine. Then I/we need to write an FCP proposal 😁

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Nov 3, 2025
Do not propogate unnecessary closure constraints.
@LorrensP-2158466
Copy link
Contributor Author

let's do a crater run, even if I think it should be fine. Then I/we need to write an FCP proposal 😁

Alright!

@LorrensP-2158466
Copy link
Contributor Author

Then I/we need to write an FCP proposal 😁

BTW, I would love to help with this if isn't to much to ask. I have never done it, so I might as well get some experience. :)

@rust-bors
Copy link

rust-bors bot commented Nov 3, 2025

☀️ Try build successful (CI)
Build commit: f27166d (f27166d4c64dc29edc5ea3214357f191edf8b635, parent: f5711a55f5d5e2f942057d0f6d648dd2d8b2c37b)

@rust-timer

This comment has been minimized.

@lcnr
Copy link
Contributor

lcnr commented Nov 4, 2025

@craterbot check

@craterbot
Copy link
Collaborator

👌 Experiment pr-148329 created and queued.
🤖 Automatically detected try build f27166d
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 4, 2025
@Kobzol
Copy link
Member

Kobzol commented Nov 4, 2025

@rust-timer build f27166d

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f27166d): 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)

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

Cycles

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

Binary size

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

Bootstrap: 474.205s -> 473.796s (-0.09%)
Artifact size: 390.90 MiB -> 390.90 MiB (0.00%)

@craterbot
Copy link
Collaborator

🚧 Experiment pr-148329 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@lcnr lcnr added S-waiting-on-t-types Status: Awaiting decision from T-types and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 27, 2025
@rust-rfcbot rust-rfcbot added final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. labels Nov 27, 2025
@rust-rfcbot
Copy link
Collaborator

🔔 This is now entering its final comment period, as per the review above. 🔔

@rust-rfcbot rust-rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. to-announce Announce this issue on triage meeting and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Dec 7, 2025
@rust-rfcbot
Copy link
Collaborator

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

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

// This test checks that the compiler does not propagate 'd: 'c when propagating region errors
// for the closure argument. If it did, this would fail to compile, eventhough it's a valid program.
// It should only propagate 'd: 'b.
// PR #148329 explains this in detail.
Copy link
Member

Choose a reason for hiding this comment

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

do you mean the stabilization report, or the new comments in try_propagate_universal_region_error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just te pr in general, like the information contained in it.
Is this not really done in tests?

@lqd
Copy link
Member

lqd commented Dec 8, 2025

It would be cool to also clean the git history up before merging.

@rustbot
Copy link
Collaborator

rustbot commented Dec 10, 2025

⚠️ Warning ⚠️

@LorrensP-2158466
Copy link
Contributor Author

@rustbot ready

then r=me

I don't have r privileges.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 10, 2025
@LorrensP-2158466 LorrensP-2158466 changed the title Do not propogate unnecessary closure constraints. Better closure requirement propagation. Dec 10, 2025
@rust-log-analyzer

This comment has been minimized.

@lqd
Copy link
Member

lqd commented Dec 10, 2025

And just for completeness' sake, there still are a handful of todos in the stabilization report.

See the tests added in this PR for things which now compile.

If we incorrectly do not propagate any constraints if there are no longer_fr- then the test TODO fails.

If we incorrectly propagate no constraints in case none of them are already
required, i.e. the subset is empty, then the test TODO fails.

@Kobzol
Copy link
Member

Kobzol commented Dec 10, 2025

@bors delegate+

Now you can approve the PR :)

@bors
Copy link
Collaborator

bors commented Dec 10, 2025

✌️ @LorrensP-2158466, you can now approve this pull request!

If @Kobzol told you to "r=me" after making some further change, please make that change, then do @bors r=@Kobzol

@lcnr
Copy link
Contributor

lcnr commented Dec 10, 2025

And just for completeness' sake, there still are a handful of todos in the stabilization report.

See the tests added in this PR for things which now compile.
If we incorrectly do not propagate any constraints if there are no longer_fr- then the test TODO fails.
If we incorrectly propagate no constraints in case none of them are already
required, i.e. the subset is empty, then the test TODO fails.

@LorrensP-2158466 i remember u looking into which tests go from pass -> fail for these TODOs? 🤔 can you link to one of them for each of these todos before merging?

@LorrensP-2158466
Copy link
Contributor Author

@LorrensP-2158466 i remember u looking into which tests go from pass -> fail for these TODOs? 🤔 can you link to one of them for each of these todos before merging?

Do you mean those listed in the zulip thread? #t-types > work on FCP proposal for closure requirements @ 💬
There were a bunch of them, but you also asked:

I would like to have a single specific test which goes from correctly erroring to failing with these changes

And I have never found such a test nor could I create one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. S-waiting-on-t-types Status: Awaiting decision from T-types T-types Relevant to the types team, which will review and decide on the PR/issue. to-announce Announce this issue on triage meeting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unnecessary closure constraint propagation overly restrictive closure borrow-checking

10 participants