3 ms·
I think this is a valid question. C++ provides std::is_same<U, T>, why do Rust users need an external dependency (especially given the fact that the type system
by nemetroid 5y ago
I think this is a valid question. C++ provides std::is_same<U, T>, why do Rust users need an external dependency (especially given the fact that the type system is one of Rust's major strengths)?
My best guess, going by a comment in the source code, is that this macro will not be necessary in the future, and therefore makes less sense to put in the standard library:
> Until RFC 1977 (public dependencies) is accepted, the situation where multiple different versions of the same crate are present is possible.
https://github.com/rust-lang/rfcs/pull/1977 https://github.com/rust-lang/rfcs/pull/1977
- steveklabnik 5y agoRust is pretty conservative with the standard library, and macros have a really high bar historically, because they were not namespaced.
- colejohnson66 5y agoWell, being conservative[a] with the standard library is why JavaScript’s is so small (leading to things like the `is-array` package) [a]: Not so much conservative, but just not caring