Skip to content

Commit

Permalink
Removing fmt::Debug impls
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Sep 7, 2024
1 parent 094d314 commit 5018b5b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,19 @@ flag:
$ RUSTFLAGS="-Zlocation-detail=none" cargo +nightly build --release
```

# Remove `fmt::Debug`

![Minimum Rust: Nightly](https://img.shields.io/badge/Minimum%20Rust%20Version-nightly-orange.svg)

With the [`-Zfmt-debug`](https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/fmt-debug.html) flag you can turn `#[derive(Debug)]`
and [`{:?}`](https://doc.rust-lang.org/stable/std/fmt/trait.Debug.html) formatting into no-ops.
This will ruin output of `dbg!()`, `assert!()`, `unwrap()`, etc., and may break code that unwisely relies on
the debug formatting, but it will remove derived `fmt` functions and their strings.

```bash
$ RUSTFLAGS="-Zfmt-debug=none" cargo +nightly build --release
```

# Optimize `libstd` with `build-std`

![Minimum Rust: Nightly](https://img.shields.io/badge/Minimum%20Rust%20Version-nightly-orange.svg)
Expand Down

0 comments on commit 5018b5b

Please sign in to comment.