From 42fa58ea687f6da097b192d0f9bbdc9fedc1a38a Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 22 Aug 2019 19:59:10 +0300 Subject: [PATCH] bump MSRV to 1.27.2 closes #154 --- .travis.yml | 2 +- README.md | 2 +- src/inline_lazy.rs | 13 +------------ 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index f4c3c74..e4a0da3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: rust matrix: include: - - rust: 1.24.1 + - rust: 1.27.2 - rust: stable script: - cargo test diff --git a/README.md b/README.md index c913375..680a221 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ as well as anything that requires non-const function calls to be computed. ## Minimum supported `rustc` -`1.24.1+` +`1.27.2+` This version is explicitly tested in CI and may only be bumped in new minor versions. Any changes to the supported minimum version will be called out in the release notes. diff --git a/src/inline_lazy.rs b/src/inline_lazy.rs index 6ffdc44..e2dd635 100644 --- a/src/inline_lazy.rs +++ b/src/inline_lazy.rs @@ -10,6 +10,7 @@ extern crate std; use self::std::prelude::v1::*; use self::std::cell::Cell; +use self::std::hint::unreachable_unchecked; use self::std::sync::Once; #[allow(deprecated)] pub use self::std::sync::ONCE_INIT; @@ -54,15 +55,3 @@ macro_rules! __lazy_static_create { static $NAME: $crate::lazy::Lazy<$T> = $crate::lazy::Lazy::INIT; }; } - -/// Polyfill for std::hint::unreachable_unchecked. There currently exists a -/// [crate](https://docs.rs/unreachable) for an equivalent to std::hint::unreachable_unchecked, but -/// lazy_static currently doesn't include any runtime dependencies and we've chosen to include this -/// short polyfill rather than include a new crate in every consumer's build. -/// -/// This should be replaced by std's version when lazy_static starts to require at least Rust 1.27. -unsafe fn unreachable_unchecked() -> ! { - enum Void {} - #[allow(deprecated)] - match std::mem::uninitialized::() {} -}