Debug is not always implemented. Therefore, when we implement generic functions of types, we have have to choose either: Add where T:Debug, or give up dbg! or expect or other utilities.
Is that true? Is there any way to use debug string only when Debug is implemented and use another default string when is not implemented?
Yes, the scary warning (applicable to both examples since they use feature(specialization), one of them just silences it) - it indicates that there needs to be found a way to do the same thing using feature(min_specialization) which is likely closer to how specialization will be allowed to be used in future Rust.
Note that “the same thing” must not literally be “the same thing”. The proposed workarounds, e.g. the macro I made in the other thread, or your DebugAnything wrapper, really aren’t supposed to be used in production, because they’re (both) inherently unsound.
Thus, @Vill.Snow, that “scary warning” you currently get isn’t without reason.