rust-lang / rust-lang/reference
`Foo<T>` can implement `CoerceUnsized<Foo<U>>` when `T` implements `CoerceUnsized<U>` rather than `CoerceUnsized<Foo<U>>`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.6k
- Forks
- 607
- PR merge metrics
- PR metrics pending
Description
https://doc.rust-lang.org/reference/type-coercions.html#unsized-coercions
Additionally, a type
Foo<T>can implementCoerceUnsized<Foo<U>>whenTimplementsUnsize<U>orCoerceUnsized<Foo<U>>. This allows it to provide a unsized coercion toFoo<U>.
However, the document of CoerceUnsized regarding the corresponding case says:
you can directly implement
CoerceUnsized<Wrap<U>>forWrap<T>where T:CoerceUnsized<U>
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 with the Rust Reference unsized-coercions section and the std::ops::CoerceUnsized documentation linked in the issue. Compare their descriptions of the generic coercion relationship and update the documentation so the corresponding cases agree. Done means the two linked documents describe the same supported behavior accurately.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100