Skip to content

Commit 2626a88

Browse files
committed
Merge pull request #22 from SimonSapin/patch-1
Use std::intrinsics::unreachable instead of an infinite loop
2 parents 0cef85e + b6c92bc commit 2626a88

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ The `Deref` implementation uses a hidden static variable that is guarded by a at
6868
6969
*/
7070

71-
#![cfg_attr(feature="nightly", feature(const_fn))]
71+
#![cfg_attr(feature="nightly", feature(const_fn, core_intrinsics))]
7272
#![crate_type = "dylib"]
7373

7474
#[macro_export]
@@ -108,7 +108,7 @@ macro_rules! lazy_static {
108108
});
109109
match *DATA.0.get() {
110110
Some(ref x) => x,
111-
None => loop { /* unreachable */ },
111+
None => ::std::intrinsics::unreachable(),
112112
}
113113
}
114114

tests/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg_attr(feature="nightly", feature(const_fn))]
1+
#![cfg_attr(feature="nightly", feature(const_fn, core_intrinsics))]
22

33
#[macro_use]
44
extern crate lazy_static;

0 commit comments

Comments
 (0)