Skip to content

Finalize repeat expr inference behaviour with inferred repeat counts#139635

Merged
bors merged 6 commits intorust-lang:masterfrom
BoxyUwU:no_order_dependent_copy_checks
May 23, 2025
Merged

Finalize repeat expr inference behaviour with inferred repeat counts#139635
bors merged 6 commits intorust-lang:masterfrom
BoxyUwU:no_order_dependent_copy_checks

Conversation

@BoxyUwU
Copy link
Copy Markdown
Member

@BoxyUwU BoxyUwU commented Apr 10, 2025

I believe this should be the last change of how repeat exprs are handled before it's finished for generic_arg_infer. Assuming we don't wind up deciding to replace this all with a new predicate kind :)

This PR has three actual changes:

  • Always defer the checks to end of typeck even when generic arg infer is not enabled (needs an FCP)
  • Properly handle element exprs that are constants when the repeat count is inferred
  • "Isolate" each repeat expr check so that inference constraints from Copy goals dont affect other repeat expr checks resulting in weird order-dependent inference

The commit history and tests should be relatively helpful for understanding this PR's impl.

r? compiler-errors

Loading
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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-types Relevant to the types 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