Docs & `rustdoc`: Mark traits that have indirect and synthetic impls
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
There's a lot of implicit stuff going on behind the scenes in Rust that's dictated by the very nature of the trait-based type systems. However, that doesn't change the fact that hidden complexity makes it difficult to understand other people's code and write your own, let alone learn the language for newbies.
One example of such complexity is side effects of importing traits from other modules, when seemingly familiar types can suddenly acquire new methods and even operational semantics. But since we can declare the use of elements without naming each of them individually, with asterisk wildcard syntax, these methods begin to look like as though they came out of nowhere. And sometimes this approach is even preferable and officially recommended - see e.g. std::io::prelude.
This problem could be greatly mitigated if such traits were distinctly marked out on overview pages. This includes:
- Traits that have blanket implementations. The most prominent example here is
Any. - Traits that have implementations on foreign types, along with generic (i.e. covered) ones. A good illustration of it is
zerocopy::Unaligned. - Auto traits: as of 1.82.0, this is
Send,Sync,Unpin,UnwindSafe,RefUnwindSafe,Freeze(unstable) andSized.
They don't quite fit the stated criterion, but are close to it in spirit, so I think it would be nice to also highlight them from the general mass.
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 locating rustdoc's trait overview rendering and checking how blanket, foreign, generic, and auto-trait implementations are currently represented. Compare the affected examples in the issue, then define a consistent visible marker for each applicable trait category and verify the generated overview pages show it without obscuring existing implementation information.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100