-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace all std with alloc except for std::error::Error #59
Conversation
#[macro_export] | ||
macro_rules! try_copy { | ||
($res:expr) => {{ | ||
use std::borrow::Cow; | ||
use $crate::alloc::borrow::Cow; // TODO: There *has* to be a better way of doing this, right? (also below) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a better way of doing this? Nothing I'd thought of worked :v
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
::alloc::borrow
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to pass when built with only the alloc
feature, so we can start with that.
- Remember that
Vec
needs to be imported manually withalloc
.
#[cfg(feature = "alloc")]
use alloc::vec::Vec;
no_std
withalloc
already providescore
, so theextern crate
must be conditioned onstd
rather thanalloc
#[cfg(feature = "std")]
extern crate core;
- The tests need to define a global allocator under these conditions. This might require a nightly toolchain.
…d no_std{,+alloc} build systems to Sublime project Coulda sworn this built for me but maybe I fucked up the switches Ref: #59
Ah, yeah, I must've used the wrong arguments when testing previously. The doctests say error now, too, and before any of them get compiled, but they still pass, so false negative? |
Released in v0.11.0-rc.2 |
With only one hiccup!
Closes #58