File tree Expand file tree Collapse file tree 2 files changed +6
-13
lines changed
Expand file tree Collapse file tree 2 files changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -43,10 +43,4 @@ fn main() {
4343 } ;
4444
4545 println ! ( "cargo:rustc-cfg=lazy_static_{}_impl" , impl_name) ;
46-
47- let version_geq_127 = version ( ) . unwrap ( ) >= Version :: new ( 1 , 27 , 0 ) ;
48- let core_unreachable_unchecked_supported = version_geq_127 || nightly_feature_enabled;
49- if core_unreachable_unchecked_supported {
50- println ! ( "cargo:rustc-cfg=lazy_static_core_unreachable_unchecked" ) ;
51- }
5246}
Original file line number Diff line number Diff line change @@ -47,13 +47,12 @@ macro_rules! __lazy_static_create {
4747 } ;
4848}
4949
50- #[ cfg( lazy_static_core_unreachable_unchecked) ]
51- use core:: hint:: unreachable_unchecked;
52-
53- #[ cfg( not( lazy_static_core_unreachable_unchecked) ) ]
54- /// Polyfill for core::hint::unreachable_unchecked. Included to support Rust prior to 1.27. See
55- /// [issue #102](https://github.com/rust-lang-nursery/lazy-static.rs/issues/102#issuecomment-400959779)
56- /// for details.
50+ /// Polyfill for std::hint::unreachable_unchecked. There currently exists a
51+ /// [crate](https://docs.rs/unreachable) for an equivalent to std::hint::unreachable_unchecked, but
52+ /// lazy_static currently doesn't include any runtime dependencies and we've chosen to include this
53+ /// short polyfill rather than include a new crate in every consumer's build.
54+ ///
55+ /// This should be replaced by std's version when lazy_static starts to require at least Rust 1.27.
5756unsafe fn unreachable_unchecked ( ) -> ! {
5857 enum Void { }
5958 match std:: mem:: uninitialized :: < Void > ( ) { }
You can’t perform that action at this time.
0 commit comments