Skip to content
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 no_std support #49

Merged
merged 1 commit into from
Jun 20, 2017
Merged

Add no_std support #49

merged 1 commit into from
Jun 20, 2017

Conversation

Pratyush
Copy link
Contributor

@Pratyush Pratyush commented May 20, 2017

This library can easily support no_std code on nightly; it does require the collections feature, however. This PR adds support for this feature by enabling a on-by-default std feature. This feature can be turned off to support no_std mode.


This change is Reviewable

@nox
Copy link
Contributor

nox commented May 20, 2017

Usually crates define a no_std method, not a default std one.

@nox
Copy link
Contributor

nox commented May 20, 2017

Or maybe I dreamt that... I was pretty sure it was the case for serde but turns out it's not. Disregard me.

@Pratyush
Copy link
Contributor Author

Sure, I can do that too. Some crates follow that convention, but some others don't (like serde). It's a bit of a mess in that regard. I followed the convention that serde is using.

@nox
Copy link
Contributor

nox commented May 20, 2017

Following serde is always a good default choice. :)

@est31
Copy link

est31 commented May 20, 2017

no_std is an anti pattern, see rust-lang/rfcs#1841 (The RFC itself is being rejected, but it stays an antipattern).

@mbrubeck
Copy link
Collaborator

I think no_std support is definitely a good thing for this crate, and I don't see any remaining questions about this patch. I plan to r+ it unless there are any objections.

Unfortunately we delayed long enough that the collections crate has been deprecated and its contents have been moved to alloc. Could you update this to use alloc, please?

@mbrubeck
Copy link
Collaborator

@bors-servo r+

Since the move to alloc only causes a warning for now, I think it's easier to merge this and then file a follow-up for that issue.

@bors-servo
Copy link
Contributor

📌 Commit 47d33b1 has been approved by mbrubeck

@bors-servo
Copy link
Contributor

⌛ Testing commit 47d33b1 with merge b7f5fe5...

bors-servo pushed a commit that referenced this pull request Jun 20, 2017
Add no_std support

This library can easily support `no_std` code on `nightly`; it does require the `collections` feature, however. This PR adds support for this feature by enabling a on-by-default `std` feature. This feature can be turned off to support `no_std` mode.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-smallvec/49)
<!-- Reviewable:end -->
@Pratyush
Copy link
Contributor Author

The other thing is that I believe that the collections crate still exists; now it's just a wrapper around alloc: rust-lang/rust#42720

@bors-servo
Copy link
Contributor

☀️ Test successful - status-travis
Approved by: mbrubeck
Pushing b7f5fe5 to master...

@bors-servo bors-servo merged commit 47d33b1 into servo:master Jun 20, 2017
mbrubeck added a commit to mbrubeck/rust-smallvec that referenced this pull request Jun 20, 2017
New features:

* `no_std` support (servo#49).
mbrubeck added a commit to mbrubeck/rust-smallvec that referenced this pull request Jun 20, 2017
New features:

* `no_std` support (servo#49).
mbrubeck added a commit to mbrubeck/rust-smallvec that referenced this pull request Jun 21, 2017
New features:

* `no_std` support (servo#49).
mbrubeck added a commit to mbrubeck/rust-smallvec that referenced this pull request Jun 23, 2017
New features:

* `no_std` support (servo#49).
* `SmallVec<[u8; N]>` implements the `Write` trait (servo#52).
mbrubeck added a commit to mbrubeck/rust-smallvec that referenced this pull request Jun 28, 2017
New features:

* `no_std` support (servo#49).
* `SmallVec<[u8; N]>` implements the `Write` trait (servo#52).
* Add an `ExtendFromSlice` trait for both `Vec` and `SmallVec` (servo#54).
bors-servo pushed a commit that referenced this pull request Jun 29, 2017
Document and test no_std support

This builds on the new "std" Cargo feature added in #49.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-smallvec/53)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants