Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing fmt::Debug impls #71

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)]`
johnthagen marked this conversation as resolved.
Show resolved Hide resolved
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