Skip to content

Commit

Permalink
Inline ptr::null(_mut) even in debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
tesuji committed Oct 2, 2019
1 parent 7130fc5 commit d0862ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libcore/ptr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ unsafe fn real_drop_in_place<T: ?Sized>(to_drop: &mut T) {
/// let p: *const i32 = ptr::null();
/// assert!(p.is_null());
/// ```
#[inline]
#[inline(always)]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_promotable]
pub const fn null<T>() -> *const T { 0 as *const T }
Expand All @@ -203,7 +203,7 @@ pub const fn null<T>() -> *const T { 0 as *const T }
/// let p: *mut i32 = ptr::null_mut();
/// assert!(p.is_null());
/// ```
#[inline]
#[inline(always)]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_promotable]
pub const fn null_mut<T>() -> *mut T { 0 as *mut T }
Expand Down

0 comments on commit d0862ec

Please sign in to comment.