Closed pranav-bhatt closed 4 years ago
In a no_std
environment, there is no Error
trait and there is no Box
type (or allocation of any kind!), so your goal is not attainable.
I'd recommend against having something like Other { source: Box<dyn std::error::Error> }
. Instead, I think it's better to have distinct error variants for each unique failure case. By doing that, you get better error messages for your users and get no-std compatibility for "free".
I couldn't find anything regarding this in the docs. I'm trying to make a library
no_std
compatible, however I'm getting stuck in the following lines :Here, I need to replace
std::error:Error
with an appropriate trait. I assume the inbuilt "std::error alternative" would work fine for this, but I don't think I can access it :PAny advice on what I could do? Thanks!