Array repeat exprs dont permit non-copy adt ctors as elements
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
I tried this code:
fn main() {
struct Foo;
[Foo; 2];
}
I expected to see this happen: it works because we attempt to permit paths to const items as repeat expr elements without Copy holding. It's also trivial to just write [const { Foo }; 2] so the lack of expressiveness doesn't really matter here too much but it feels somewhat inconsistent
Instead, this happened: error
Meta
rustc --version --verbose:
latest playground
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by compiling the minimal Rust program shown in the issue and compare it with the const-block form that already works. No source file or test is named; done means the direct array repeat expression accepts the non-Copy ADT constructor without requiring the const-block workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100