Skip to content

Commit 01a34b4

Browse files
committed
Auto merge of #333 - JustForFun88:offset_from_del_attrib, r=Amanieu
Deleting #[cfg(not(feature = "nightly"))] attributes Deleting two version of offset_from<T> function (for #[cfg(feature = "nightly")] and #[cfg(not(feature = "nightly"))]) because ptr::offset_from stable since rust 1.47.0.
2 parents 426d5ea + 4d614c0 commit 01a34b4

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/raw/mod.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,10 @@ fn unlikely(b: bool) -> bool {
6969
b
7070
}
7171

72-
#[cfg(feature = "nightly")]
7372
#[inline]
7473
unsafe fn offset_from<T>(to: *const T, from: *const T) -> usize {
7574
to.offset_from(from) as usize
7675
}
77-
#[cfg(not(feature = "nightly"))]
78-
#[inline]
79-
unsafe fn offset_from<T>(to: *const T, from: *const T) -> usize {
80-
(to as usize - from as usize) / mem::size_of::<T>()
81-
}
8276

8377
/// Whether memory allocation errors should return an error or abort.
8478
#[derive(Copy, Clone)]

0 commit comments

Comments
 (0)