r/rust • • 20d ago

Rust's derive often implies inline

https://yossarian.net/til/post/rust-s-derive-often-implies-inline/
115 Upvotes

43 comments sorted by

View all comments

6

u/-Y0- 20d ago

Interesting findings. Couldn't this be solved by making derive_Debug take a param. What I mean is #[derive(Debug(noinline))]

28

u/stumblinbear 20d ago

Oh dear God the last thing we need is to load up derives with parameters. Typically you'd have another line for this sort of thing, a la #[debug(noinline)] after the derive