Skip to content

Instantly share code, notes, and snippets.

@jonas-schievink
Created April 29, 2020 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonas-schievink/96fb1da903397d6f293587e059496b9d to your computer and use it in GitHub Desktop.
Save jonas-schievink/96fb1da903397d6f293587e059496b9d to your computer and use it in GitHub Desktop.
Contributing to Rust

Contribution Workflows

  • Doc-only changes:

    ./x.py doc --stage=0 src/libstd

  • libstd-only changes:

    ./x.py check --stage=0 src/libstd

  • Run tests on individual crate

    cargo test -p

  • Always use --stage=1

    ./x.py test --stage=1

  • Tidy checks only

    ./x.py test --stage=0 src/tools/tidy

Where to start?

Check the issue tracker:

  • E-easy / E-needs-test
  • C-cleanup

Ask:

  • On Zulip or Discord
  • Specific working groups

Compiler Performance

  • There's a working group for that!
  • Pathological cases: Open an issue
  • Tooling:
    • perf record
    • cargo flamegraph
    • rustc -Zself-profile – has working group WG-self-profile

MIR optimizations

Parse Code -> AST -> HIR -> MIR -> LLVM IR -> Machine Code

  • WG-mir-opt
  • Passes:
    • SimplifyCfg, instcombine, simplifyX (most on by default)
    • Constant Propagation (on by default)
    • Inliner (working on turning it on by default)
    • Copy Propagation / NRVO (WIP)
  • Other work:
    • Polymorphization to avoid instantiating generic MIR bodies more often than needed
    • Other ideas around making generics more efficient
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment