Does `#[derive(Debug)]` increase binary size?

⚓ Rust    📅 2025-09-13    👤 surdeus    👁️ 10      

surdeus

Warning

This post was published 61 days ago. The information described in this article may have changed.

Hi, I've read some comments about the #[derive(Debug)], says it increases the code size and binary size, especially the "release" profile. Is it true?

If yes, can I replace all derive(Debug) with impl std::fmt::Display? Since I think I still need to print the structure for debugging.

1 post - 1 participant

Read full topic

🏷️ Rust_feed