Allow `where` clauses on enum variants
Nobody has claimed this yet.
- Dominant language
- Markdown
- Stars
- 6.6k
- Forks
- 1.7k
- Avg merge
- 16h 14m
- Merged PRs (30d)
- 1
Description
Described here: https://internals.rust-lang.org/t/pre-rfc-trait-bounds-on-individual-enum-variants/9514
My personal use-case is to add the Sized bound to an enum variant to avoid boxing, eg.
enum Foo<T: ?Sized> {
Concrete(ConcreteImpl<T>) where T: Sized,
Upcasted(Box<dyn Impl<T>>),
}
For the moment, I'm forced to always use the boxed representation, even if Foo is never upcasted to a Foo<dyn Bar> and always operates on concrete types.
Contributor guide
No contributing guide indexed for this repository
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 reading the linked pre-RFC and the enum example in this issue. Determine the intended syntax and semantics for bounds on individual enum variants, including the Sized use case. Done means the proposal is fully specified and its interaction with generic and dynamically sized types is resolved.
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
- Needs clarification
- Newbie friendliness
- 25/100