diff options
author | Manish Goregaokar <manishsmail@gmail.com> | 2017-01-06 16:32:29 -0800 |
---|---|---|
committer | Manish Goregaokar <manishsmail@gmail.com> | 2017-01-06 20:28:17 -0800 |
commit | 49187d53f2f8b7cfca9105c3fb00d7c29e2a457b (patch) | |
tree | 44e78783b3397404d6af5a6bc969b95b23d517c4 /src/util.rs | |
parent | fbeded8ac543613b89af2ed7fd856e978493cde4 (diff) | |
download | alacritty-49187d53f2f8b7cfca9105c3fb00d7c29e2a457b.tar.gz alacritty-49187d53f2f8b7cfca9105c3fb00d7c29e2a457b.zip |
Add `nightly` feature, use for `unlikely` intrinsic
Diffstat (limited to 'src/util.rs')
-rw-r--r-- | src/util.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/util.rs b/src/util.rs index 44f7b3de..2e34b2a6 100644 --- a/src/util.rs +++ b/src/util.rs @@ -13,6 +13,15 @@ // limitations under the License. use std::cmp; +#[cfg(not(feature = "nightly"))] +#[inline(always)] +pub unsafe fn unlikely(x: bool) -> bool { + x +} + +#[cfg(feature = "nightly")] +pub use ::std::intrinsics::unlikely; + /// Threading utilities pub mod thread { /// Like `thread::spawn`, but with a `name` argument |