Switch to 'const unsafe fn' ordering (rust-lang/rust#29107)

This commit is contained in:
John Hodge
2015-10-24 16:52:07 +08:00
parent bbb5f8e12e
commit f9b8c49cdb
6 changed files with 21 additions and 16 deletions

View File

@@ -55,7 +55,7 @@ macro_rules! nonzero_new {
/// Creates an instance of NonZero with the provided value.
/// You must indeed ensure that the value is actually "non-zero".
#[inline(always)]
pub unsafe const fn new(inner: T) -> NonZero<T> {
pub const unsafe fn new(inner: T) -> NonZero<T> {
NonZero(inner)
}
)

View File

@@ -511,7 +511,7 @@ macro_rules! unique_new {
macro_rules! unique_new {
() => (
/// Creates a new `Unique`.
pub unsafe const fn new(ptr: *mut T) -> Unique<T> {
pub const unsafe fn new(ptr: *mut T) -> Unique<T> {
Unique { pointer: NonZero::new(ptr), _marker: PhantomData }
}
)