Merge pull request #26 from bluss/nodrop-std
nodrop: Add std as default feature to enable libstd
This commit is contained in:
@@ -12,6 +12,11 @@ repository = "https://github.com/bluss/arrayvec"
|
|||||||
keywords = ["container", "drop"]
|
keywords = ["container", "drop"]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
default = ["std"]
|
||||||
|
|
||||||
|
# Default, Rust 1.6+
|
||||||
|
# Use libstd
|
||||||
|
std = []
|
||||||
|
|
||||||
# Optional, nightly channel
|
# Optional, nightly channel
|
||||||
# Use no drop flag. See API doc for more info.
|
# Use no drop flag. See API doc for more info.
|
||||||
|
|||||||
+10
-6
@@ -1,6 +1,10 @@
|
|||||||
//!
|
//!
|
||||||
//! The **nodrop** crate has the following cargo feature flags:
|
//! The **nodrop** crate has the following cargo feature flags:
|
||||||
//!
|
//!
|
||||||
|
//! - `std`
|
||||||
|
//! - Optional, enabled by default
|
||||||
|
//! - Requires Rust 1.6 *to disable*
|
||||||
|
//! - Use libstd
|
||||||
//! - `use_needs_drop`
|
//! - `use_needs_drop`
|
||||||
//! - Optional
|
//! - Optional
|
||||||
//! - Requires nightly channel.
|
//! - Requires nightly channel.
|
||||||
@@ -17,17 +21,17 @@
|
|||||||
#![cfg_attr(feature="no_drop_flag", feature(unsafe_no_drop_flag))]
|
#![cfg_attr(feature="no_drop_flag", feature(unsafe_no_drop_flag))]
|
||||||
#![cfg_attr(feature="use_needs_drop", feature(core_intrinsics))]
|
#![cfg_attr(feature="use_needs_drop", feature(core_intrinsics))]
|
||||||
|
|
||||||
#![cfg_attr(not(test), no_std)]
|
#![cfg_attr(not(any(test, feature="std")), no_std)]
|
||||||
#[cfg(test)]
|
#[cfg(not(any(test, feature="std")))]
|
||||||
extern crate core;
|
extern crate core as std;
|
||||||
|
|
||||||
extern crate odds;
|
extern crate odds;
|
||||||
|
|
||||||
use odds::debug_assert_unreachable;
|
use odds::debug_assert_unreachable;
|
||||||
|
|
||||||
use core::ops::{Deref, DerefMut};
|
use std::ops::{Deref, DerefMut};
|
||||||
use core::ptr;
|
use std::ptr;
|
||||||
use core::mem;
|
use std::mem;
|
||||||
|
|
||||||
/// repr(u8) - Make sure the non-nullable pointer optimization does not occur!
|
/// repr(u8) - Make sure the non-nullable pointer optimization does not occur!
|
||||||
#[repr(u8)]
|
#[repr(u8)]
|
||||||
|
|||||||
Reference in New Issue
Block a user