Skip to content

Commit d9c9689

Browse files
authored
Merge pull request #155 from matklad/hints
bump MSRV to 1.27.2
2 parents 8a5f404 + d59c784 commit d9c9689

File tree

3 files changed

+5
-16
lines changed

3 files changed

+5
-16
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: rust
22
matrix:
33
include:
4-
- rust: 1.24.1
4+
- rust: 1.27.2
55
- rust: stable
66
script:
77
- cargo test

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ as well as anything that requires non-const function calls to be computed.
1515

1616
## Minimum supported `rustc`
1717

18-
`1.24.1+`
18+
`1.27.2+`
1919

2020
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.
2121

src/inline_lazy.rs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ extern crate std;
1010

1111
use self::std::prelude::v1::*;
1212
use self::std::cell::Cell;
13+
use self::std::hint::unreachable_unchecked;
1314
use self::std::sync::Once;
1415
#[allow(deprecated)]
1516
pub use self::std::sync::ONCE_INIT;
1617

17-
// FIXME: Replace Option<T> with MaybeInitialized<T>
18+
// FIXME: Replace Option<T> with MaybeUninit<T> (stable since 1.36.0)
1819
pub struct Lazy<T: Sync>(Cell<Option<T>>, Once);
1920

2021
impl<T: Sync> Lazy<T> {
@@ -31,7 +32,7 @@ impl<T: Sync> Lazy<T> {
3132
});
3233

3334
// `self.0` is guaranteed to be `Some` by this point
34-
// The `Once` will catch and propegate panics
35+
// The `Once` will catch and propagate panics
3536
unsafe {
3637
match *self.0.as_ptr() {
3738
Some(ref x) => x,
@@ -54,15 +55,3 @@ macro_rules! __lazy_static_create {
5455
static $NAME: $crate::lazy::Lazy<$T> = $crate::lazy::Lazy::INIT;
5556
};
5657
}
57-
58-
/// Polyfill for std::hint::unreachable_unchecked. There currently exists a
59-
/// [crate](https://docs.rs/unreachable) for an equivalent to std::hint::unreachable_unchecked, but
60-
/// lazy_static currently doesn't include any runtime dependencies and we've chosen to include this
61-
/// short polyfill rather than include a new crate in every consumer's build.
62-
///
63-
/// This should be replaced by std's version when lazy_static starts to require at least Rust 1.27.
64-
unsafe fn unreachable_unchecked() -> ! {
65-
enum Void {}
66-
#[allow(deprecated)]
67-
match std::mem::uninitialized::<Void>() {}
68-
}

0 commit comments

Comments
 (0)