How I yearn for some attributes to customize deriving `Debug`. For example: #[derive(Debug)] struct MissingCookie { #[debug::skip] _priv: (), }
What is this pattern of embedding a private unit member in pub structs about? I vaugely recall this had to do with API stability but is that still relevant with the non_exhaistive attribute that stabilized in 1.40?https://blog.rust-lang.org/2019/12/19/Rust-1.40.0.html …
-
-
Yes, it's for stability. By not exposing publicly the layout, you can add new fields without breaking users who were constructing it without a function. I haven't toyed with non_exhaustive, since it's so new!
-
Nice. Thanks for the explanation
Kraj razgovora
Novi razgovor -
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.




