nodrop: Use odds & bump version

This commit is contained in:
root
2015-06-02 17:27:44 +02:00
parent 48fdc7e651
commit 7c92874782
2 changed files with 8 additions and 19 deletions
+4 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "nodrop"
version = "0.1.2"
version = "0.1.3"
authors = ["bluss"]
license = "MIT/Apache-2.0"
@@ -16,3 +16,6 @@ keywords = ["container", "drop"]
# Optional, nightly channel
# Use no drop flag. See API doc for more info.
no_drop_flag = []
[dependencies.odds]
version = "0.1"
+4 -18
View File
@@ -12,6 +12,10 @@
#![cfg_attr(feature="no_drop_flag", feature(unsafe_no_drop_flag))]
extern crate odds;
use odds::debug_assert_unreachable;
use std::ops::{Deref, DerefMut};
use std::ptr;
use std::mem;
@@ -58,24 +62,6 @@ impl<T> Drop for NoDrop<T> {
}
}
enum Void { }
/// FIXME: Replace with intrinsic when it's stable
#[inline]
unsafe fn unreachable() -> ! {
let void: &Void = mem::transmute(&());
match *void {
// no cases
}
}
#[inline]
unsafe fn debug_assert_unreachable() -> ! {
debug_assert!(false, "Entered unreachable section, this is a bug!");
unreachable()
}
impl<T> Deref for NoDrop<T> {
type Target = T;