about summary refs log tree commit diff
path: root/src/libcore/ptr/const_ptr.rs
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2020-06-21 12:28:33 +0200
committerRalf Jung <post@ralfj.de>2020-06-21 13:50:06 +0200
commit467415d50cdf8a0d15ec19dc63251443b35d4cee (patch)
tree717f177ea84975df9bb0344f61bc22a35970a255 /src/libcore/ptr/const_ptr.rs
parent228a0ed7b0cef2fbfeb781acf6c23015ccc40ba2 (diff)
downloadrust-467415d50cdf8a0d15ec19dc63251443b35d4cee.tar.gz
rust-467415d50cdf8a0d15ec19dc63251443b35d4cee.zip
deprecate wrapping_offset_from
Diffstat (limited to 'src/libcore/ptr/const_ptr.rs')
-rw-r--r--src/libcore/ptr/const_ptr.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libcore/ptr/const_ptr.rs b/src/libcore/ptr/const_ptr.rs
index e39d18d7733..acc09ddc014 100644
--- a/src/libcore/ptr/const_ptr.rs
+++ b/src/libcore/ptr/const_ptr.rs
@@ -330,6 +330,12 @@ impl<T: ?Sized> *const T {
     /// assert_eq!(ptr2.wrapping_offset_from(ptr1), 2);
     /// ```
     #[unstable(feature = "ptr_wrapping_offset_from", issue = "41079")]
+    #[rustc_deprecated(
+        since = "1.46.0",
+        reason = "Pointer distances across allocation \
+        boundaries are not typically meaningful. \
+        Use integer subtraction if you really need this."
+    )]
     #[inline]
     pub fn wrapping_offset_from(self, origin: *const T) -> isize
     where