rust-lang / rust-lang/rust

Type inference of inferred repeat expr counts is not as strong as it could be

Open
#140,855 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-array C-bug F-generic_arg_infer F-marker_trait_attr T-compiler T-types
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

See the FCP writeup for inference of inferred repeat expr counts: https://github.com/rust-lang/rust/pull/139635#issuecomment-2794578322

Once marker traits are stable we should experiment with a RepeatExprWf lang item trait in core with marker impls for [T: Copy; N], [T; 0] and [T; 1] which will allow for proper ability to defer/stall the repeat expr wf checks.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the linked FCP writeup and its discussion. Then investigate the compiler's repeat-expression well-formedness checks and the proposed RepeatExprWf lang item trait in core, including marker implementations for the listed array cases. Done means establishing whether this design can defer or stall the checks correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.