Merge pull request #80 from bluss/no-odds-in-no-drop
nodrop: Remove odds dependency
This commit is contained in:
+1
-5
@@ -17,7 +17,7 @@ default = ["std"]
|
|||||||
|
|
||||||
# Default, requires Rust 1.6+ to disable
|
# Default, requires Rust 1.6+ to disable
|
||||||
# Use libstd
|
# Use libstd
|
||||||
std = ["odds/std"]
|
std = []
|
||||||
|
|
||||||
# Optional, Rust 1.21.0
|
# Optional, Rust 1.21.0
|
||||||
# Use `needs_drop` to skip overwriting if not necessary
|
# Use `needs_drop` to skip overwriting if not necessary
|
||||||
@@ -26,10 +26,6 @@ use_needs_drop = []
|
|||||||
# Optional, nightly channel
|
# Optional, nightly channel
|
||||||
use_union = ["nodrop-union"]
|
use_union = ["nodrop-union"]
|
||||||
|
|
||||||
[dependencies.odds]
|
|
||||||
version = "0.2.12"
|
|
||||||
default-features = false
|
|
||||||
|
|
||||||
[dependencies.nodrop-union]
|
[dependencies.nodrop-union]
|
||||||
path = "../nodrop-union"
|
path = "../nodrop-union"
|
||||||
version = "0.1.8"
|
version = "0.1.8"
|
||||||
|
|||||||
+8
-4
@@ -19,9 +19,6 @@
|
|||||||
#[cfg(not(any(test, feature="std")))]
|
#[cfg(not(any(test, feature="std")))]
|
||||||
extern crate core as std;
|
extern crate core as std;
|
||||||
|
|
||||||
#[cfg(not(feature = "use_union"))]
|
|
||||||
extern crate odds;
|
|
||||||
|
|
||||||
#[cfg(feature = "use_union")]
|
#[cfg(feature = "use_union")]
|
||||||
extern crate nodrop_union as imp;
|
extern crate nodrop_union as imp;
|
||||||
|
|
||||||
@@ -30,7 +27,6 @@ pub use imp::NoDrop;
|
|||||||
|
|
||||||
#[cfg(not(feature = "use_union"))]
|
#[cfg(not(feature = "use_union"))]
|
||||||
mod imp {
|
mod imp {
|
||||||
use odds::debug_assert_unreachable;
|
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use std::ops::{Deref, DerefMut};
|
use std::ops::{Deref, DerefMut};
|
||||||
@@ -125,6 +121,14 @@ mod imp {
|
|||||||
assert!(mem::size_of::<Flag<&i32>>() > mem::size_of::<&i32>());
|
assert!(mem::size_of::<Flag<&i32>>() > mem::size_of::<&i32>());
|
||||||
assert!(mem::size_of::<Flag<Vec<i32>>>() > mem::size_of::<Vec<i32>>());
|
assert!(mem::size_of::<Flag<Vec<i32>>>() > mem::size_of::<Vec<i32>>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// copying this code saves us microcrate deps
|
||||||
|
#[inline]
|
||||||
|
unsafe fn debug_assert_unreachable() -> ! {
|
||||||
|
debug_assert!(false, "Reached unreachable section: this is a bug!");
|
||||||
|
enum Void { }
|
||||||
|
match *(1 as *const Void) { }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|||||||
Reference in New Issue
Block a user