If you care about rust compile times, this may be of interest: we've recently switched rustc to use lld as the default linker on x64 linux.

We do this on nightly only for now, to expand testing and catch issues early. We've found and fixed a couple already.

Once these are all ironed out, we'll enable it for real to reach stable.

I wrote more about it, with details and some perf improvements, in https://blog.rust-lang.org/2024/05/17/enabling-rust-lld-on-linux.html

It's fast, especially for debug builds (e.g. -40% in ripgrep).

Faster linking times on nightly on Linux using `rust-lld` | Rust Blog

Empowering everyone to build reliable and efficient software.

@lqd PSA: If you get it through `rustup` it is broken in NixOS (known issue, NixOS doesn't provide the required libraries).

@teivel yes, you can easily deactivate it there (until it’s fixed in nix packages) to revert back to the default linker.

We have an open PR to fix it IIRC (based on work from the rust-overlay package) so hopefully it won’t be much longer.

@lqd Nice! I'm currently just switching it to mold with `cargo-wizard` and installing mold through nixpkgs c: