Why is #[derive(Default)] not implicit?

"Why is #[derive(Default)] not implicit?" could be answered with "because Rust doesn't have (or wants to have) any implicit derives because explicit is better than implicit". A practical reason is that every derive increases compilation time ever so slightly, so having them on by default would slow down everyone, regardless of whether they need this trait implemented or not. A pragmatic reason is that we don't have ways to remove a derive today, and adding such a feature would increase the complexity of the language. And the behavior when an #[underive(Default)](?) struct is a field of another, that could make for a lot of very confusing errors.

Rust could make things easier for people by having #[derive(Debug, Default, Copy, Clone, PartialEq)] be implicit for everyone, but the points raised for Default apply to all of them.

For what is worth, there's a proposal that will soon be an RFC that would allow you to write struct Pet { name: Option<String> = None, age: i32 = 0 }, which would be both explicit and user friendly (in my eyes).

Also, to all involved, please lets avoid personal attacks.

Except Send and Sync of course.

Technically those are not derives; those are auto traits. So you're both correct, depending on how literally one considers the statement.

Well, let's then clarify this appearance with a fun fact. I never used the term or phrase "I suggest". And questioning is asking, not suggesting.

If you don't want to have a clue why things are the way they are, then that's not my problem. But I did not move form C, over to C#, F# and finally to Rust just because I'm a sheep and swallow whiteout asking, or pick my language blindly.

Yeah, I was afraid that performance would be an issue, as already mentioned in the original post. To make things worse, the compile times are already long. And for projects like games, that got a lot of iterative compiles, times need to be fast.

On my Ryzen 7 3800x an engine like Bevy gets 30 seconds for a simple line change. Though, for what it's worth, Bevy itself is quite young though and may shed some seconds in the future.

Another important reason for Default and other such seemingly "basic" tools not being implicit is version compatibility. If you implement a trait for a type, removing that implementation is an incompatible change that would require a major version bump for crates.

Such traits being implicit would become a problem for the above promise of stability when you e.g. want to add private member fields to structs, something which is normally allowed without having to increase the crate version in an incompatible way. If you add a field of a type that does not implement Default, the implicit promise would be broken, requiring you to either work around it by providing a manual Default impl, or removing the Default trait altogether. An even more relevant examples of this would be the Copy trait, for which the first workaround is also impossible.

Rust makes you type such stability-relevant promises out yourself, so traits are not implicit.