Skip to content

Conversation

@LorrensP-2158466
Copy link
Contributor

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

Fixes #148289
Fixes case 1 of #104477 (it's the same as #148289)
Should unblock #148187

Instead of propogating every fr-: shorter_fr+ we find, only propogate those that matter to the closure in question. This could otherwise cause valid code to be rejected.

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
// NOTE: [] is *not* a valid subset, so we check for that as well.
if single_region
|| shorter_fr_plus == fr_static // `fr-: 'static` should be propogated
|| self.eval_outlives(fr_minus, shorter_fr_plus)
Copy link
Contributor Author

@LorrensP-2158466 LorrensP-2158466 Oct 31, 2025

Choose a reason for hiding this comment

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

I couldn't find anything else that would give me the behaviour that is intended.
Is there something more correct perhaps?

@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.

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

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unnecessary closure constraint propagation

4 participants