rust-lang / rust-lang/reference

Document all interesting/relevant zero cost abstractions

Open
#1,352 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.6k
Forks
607
PR merge metrics
PR metrics pending

Description

I've been trying to research what zero cost abstractions Rust uses and I cannot find any meaningful info on anything other than iterators and generics. I've checked the main Rust repository, the Rust book and its repository, the reference and its repository, and even third party articles about Rust. I might just be stupid but there seems to be little if any concrete information on what is and is not zero cost

I think it would be very worthwhile to have a comprehensive list of (at least the interesting) zero cost abstractions (as well as when they don't apply) both to satisfy curiosity and to reassure people who come from languages where abstractions are punished

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 reviewing the Rust Reference and the linked Rust Book sections on iterators and generics, then compare the cases discussed in issue #80416. Define the scope of the comprehensive list and document which abstractions are zero cost and when that claim does not apply.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.