16 ms·
One good reason to not do this is it's std::error::Error, but there is no corresponding core::error::Error. no_std needs to be able to use Result too.
by steveklabnik 4y ago
One good reason to not do this is it's std::error::Error, but there is no corresponding core::error::Error. no_std needs to be able to use Result too.
- deleted 4y ago[deleted]
- OJFord 4y agoThat feels a bit incomplete to me - that explains the language mechanism existing for using something different, but not std's lack of something more specific? As in, std::result could use std::error::Error to specialise core::result's more generic Result? And it's barely any extra work at all for a maintainer of a crate with a `no_std` feature, since you can still use the same Result; it's no longer required that its Error type implements std's, but it can?
- steveklabnik 4y agoRust doesn't yet have specialization. It is used internally by the standard library, but only for optimizations, as far as I know.