Skip to content

Commit 718f378

Browse files
committed
mark FIXMES for all the places found that are probably offset_from
1 parent 5a156a0 commit 718f378

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

core/src/slice/sort.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ where
269269
// Returns the number of elements between pointers `l` (inclusive) and `r` (exclusive).
270270
fn width<T>(l: *mut T, r: *mut T) -> usize {
271271
assert!(mem::size_of::<T>() > 0);
272+
// FIXME: this should *likely* use `offset_from`, but more
273+
// investigation is needed (including running tests in miri).
272274
(r.addr() - l.addr()) / mem::size_of::<T>()
273275
}
274276

std/src/sys/unix/memchr.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ pub fn memrchr(needle: u8, haystack: &[u8]) -> Option<usize> {
2626
haystack.len(),
2727
)
2828
};
29+
// FIXME: this should *likely* use `offset_from`, but more
30+
// investigation is needed (including running tests in miri).
2931
if p.is_null() { None } else { Some(p.addr() - haystack.as_ptr().addr()) }
3032
}
3133

0 commit comments

Comments
 (0)