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

Maybe remove the 'unreachable' crate dependency? #128

Closed
frewsxcv opened this issue Oct 4, 2018 · 1 comment
Closed

Maybe remove the 'unreachable' crate dependency? #128

frewsxcv opened this issue Oct 4, 2018 · 1 comment

Comments

@frewsxcv
Copy link
Contributor

frewsxcv commented Oct 4, 2018

rust-smallvec/lib.rs

Lines 48 to 49 in feb3e45

extern crate unreachable;
use unreachable::UncheckedOptionExt;

unsafe { self.pop().unchecked_unwrap() }

Seems like we might be able to replace this usage with this:

use std::hint;

// ...

unsafe {
    self.pop().unwrap_or_else(hint::unreachable_unchecked)
}
@mbrubeck
Copy link
Collaborator

mbrubeck commented Oct 8, 2018

This would increase the minimum supported Rust version from 1.20 to 1.27. Since this crate is so widely used, we try to batch such changes together along with other breaking changes. Added this to the tracking bug (#73).

mbrubeck added a commit to mbrubeck/rust-smallvec that referenced this issue Feb 16, 2019
Fixes servo#128 by inlining the tiny amount of code we use from `unreachable`
and its dependency `void`.  Eventually this can be replaced with
`std::hint::unrechable_unchecked` but this will require bumping our
minumum supported Rust version.

This will prevent build breakage from users building with broken
versions of the `void` crate, as in crossbeam-rs/crossbeam#312.
bors-servo pushed a commit that referenced this issue Feb 16, 2019
Remove dependency on unmaintained 'unreachable' crate

Fixes #128 by inlining the tiny amount of code we use from `unreachable` and its dependency `void`.  Eventually this can be replaced with `std::hint::unrechable_unchecked` but this will require bumping our minumum supported Rust version.

This will prevent build breakage from users building with broken versions of the `void` crate, as in crossbeam-rs/crossbeam#312.

<!-- 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/140)
<!-- 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

No branches or pull requests

2 participants