-
Notifications
You must be signed in to change notification settings - Fork 111
no_std support #138
Comments
Yeah, sure! I guess it would mean disabling the error chain, and maybe the backtrace. |
Bump of this. I'd like to see a backtrace-less |
I'm going to take a crack at this |
Okay, hit a snag: error-chain heavily depends on std::error, but it is not available in core. Unless anyone knows of a resolution, this seems like a bit of a showstopper. |
Went ahead and reopened this as on a second look I think it might be possible to gate |
The error-chain library does not support no_std: rust-lang-deprecated/error-chain#138 This switches to a somewhat error-chain-like set of handwritten error boilerplate, and makes sure to test in CI that the Rust crate compiles without the "std" cargo feature.
I attempted to vendor a minimalist version of the I'm beginning to think this might be more trouble than it's worth. |
Okay, so I managed to get error-chain to work with no_std, but it's not pretty: I'm not sure I'd actually want to use this unless I could get it upstream, and I think there's definitely a lot of cleanup that needs to happen first. That said, the tests pass and |
Current resolution is to push the Error trait further down into probably the alloc crate, which will make this easier. |
Hum, but if you user no_core, you don't have access to alloc, do you? |
You can allocate from I have been trying to figure out the least horrible way to do this over on the https://github.com/carllerche/bytes/pull/153/files#r127882795 What I ended up settling on was having separate The This approach makes the overall surface of the |
But then if you want |
From a practical perspective yes. We can gate everything that needs an allocator on the |
I'm thinking more about Error, which I don't really see why it will be in alloc... |
From error.rs: https://github.com/rust-lang/rust/blob/master/src/libstd/error.rs#L45
Unfortunately |
OK then |
The error-chain library does not support no_std: rust-lang-deprecated/error-chain#138 This switches to a somewhat error-chain-like set of handwritten error boilerplate, and makes sure to test in CI that the Rust crate compiles without the "std" cargo feature.
It would be neat if this crate worked with
#![no_std]
. The main thing it's using seems to beBox
, which could usecollections
in ano_std
context.If there's interest in gating the
std
stuff it uses on a cargo feature, I might be interested in submitting a PR.The text was updated successfully, but these errors were encountered: