-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add StableDeref impls for no_std types, including alloc and spin types #2
Conversation
So just to clarify, |
That's correct. Regarding You'd either be including an optional dependency on |
Seeing as this crate is literally just a trait definition, I think it makes sense to avoid dependencies. There's no reason why |
Works for me, I'll remove the |
@kevinaboos I have need of the |
@philipc ah, I completely forgot about this, got swamped at work. I'll update the PR hopefully within a day or two at the most. |
src/lib.rs
Outdated
@@ -14,11 +14,19 @@ It is intended to be used by crates such as [owning_ref](https://crates.io/crate | |||
no_std support can be enabled by disabling default features (specifically "std"). In this case, the trait will not be implemented for the std types mentioned above, but you can still use it for your own types. | |||
*/ | |||
|
|||
#![feature(alloc)] |
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.
Does this need to be #![cfg_attr(feature = "alloc", feature(alloc))]
?
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.
it's not technically required, but it's more correct that way. Changed, thanks!
Okay, I think it's ready for merging now, @Storyyeller. |
Ok, I'll try to get to it over the weekend. |
As a
no_std
Rustacean, I needed this for my own purposes. But I figured it'd be pretty useful for other people too, especially if they're usingowning_ref
in their projects.Happy to make any changes you'd prefer. One thing is that I feel the way you set the default-features is a bit confusing and can lead to weird combinations of features, but I left it as is because I didn't want to break other crates using it.
The new features are used like this:
cargo build --no-default-features --features alloc
cargo build --no-default-features --features spin