Skip to content

Commit d0862ec

Browse files
committed
Inline ptr::null(_mut) even in debug builds
1 parent 7130fc5 commit d0862ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcore/ptr/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ unsafe fn real_drop_in_place<T: ?Sized>(to_drop: &mut T) {
188188
/// let p: *const i32 = ptr::null();
189189
/// assert!(p.is_null());
190190
/// ```
191-
#[inline]
191+
#[inline(always)]
192192
#[stable(feature = "rust1", since = "1.0.0")]
193193
#[rustc_promotable]
194194
pub const fn null<T>() -> *const T { 0 as *const T }
@@ -203,7 +203,7 @@ pub const fn null<T>() -> *const T { 0 as *const T }
203203
/// let p: *mut i32 = ptr::null_mut();
204204
/// assert!(p.is_null());
205205
/// ```
206-
#[inline]
206+
#[inline(always)]
207207
#[stable(feature = "rust1", since = "1.0.0")]
208208
#[rustc_promotable]
209209
pub const fn null_mut<T>() -> *mut T { 0 as *mut T }

0 commit comments

Comments
 (0)