about summary refs log tree commit diff
path: root/src/libcore/ptr
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-06-12 13:10:57 +0000
committerbors <bors@rust-lang.org>2020-06-12 13:10:57 +0000
commit7c78a5f97de07a185eebae5a5de436c80d8ba9d4 (patch)
treee5475f282387bca43e2085d44537fdfbe69ef98d /src/libcore/ptr
parent59493917be3e87e1dfb44a9ccb66a9f9b17228e6 (diff)
parent77ede48ada25295cb90e520f52c1cbe653982f8a (diff)
Auto merge of #73276 - Dylan-DPC:rollup-hfd81qw, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #72906 (Migrate to numeric associated consts)
 - #73178 (expand: More precise locations for expansion-time lints)
 - #73225 (Allow inference regions when relating consts)
 - #73236 (Clean up E0666 explanation)
 - #73273 (Fix Zulip pings)

Failed merges:

r? @ghost
Diffstat (limited to 'src/libcore/ptr')
-rw-r--r--src/libcore/ptr/const_ptr.rs4
-rw-r--r--src/libcore/ptr/mod.rs4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/libcore/ptr/const_ptr.rs b/src/libcore/ptr/const_ptr.rs
index 835183d171a..e39d18d7733 100644
--- a/src/libcore/ptr/const_ptr.rs
+++ b/src/libcore/ptr/const_ptr.rs
@@ -291,7 +291,7 @@ impl<T: ?Sized> *const T {
         T: Sized,
     {
         let pointee_size = mem::size_of::<T>();
-        assert!(0 < pointee_size && pointee_size <= isize::max_value() as usize);
+        assert!(0 < pointee_size && pointee_size <= isize::MAX as usize);
         intrinsics::ptr_offset_from(self, origin)
     }
 
@@ -336,7 +336,7 @@ impl<T: ?Sized> *const T {
         T: Sized,
     {
         let pointee_size = mem::size_of::<T>();
-        assert!(0 < pointee_size && pointee_size <= isize::max_value() as usize);
+        assert!(0 < pointee_size && pointee_size <= isize::MAX as usize);
 
         let d = isize::wrapping_sub(self as _, origin as _);
         d.wrapping_div(pointee_size as _)
diff --git a/src/libcore/ptr/mod.rs b/src/libcore/ptr/mod.rs
index 777284ca5c0..1be05d5efff 100644
--- a/src/libcore/ptr/mod.rs
+++ b/src/libcore/ptr/mod.rs
@@ -1128,7 +1128,7 @@ pub(crate) unsafe fn align_offset<T: Sized>(p: *const T, a: usize) -> usize {
                 //
                 // Note, that we use wrapping operations here intentionally – the original formula
                 // uses e.g., subtraction `mod n`. It is entirely fine to do them `mod
-                // usize::max_value()` instead, because we take the result `mod n` at the end
+                // usize::MAX` instead, because we take the result `mod n` at the end
                 // anyway.
                 inverse = inverse.wrapping_mul(2usize.wrapping_sub(x.wrapping_mul(inverse)));
                 if going_mod >= m {
@@ -1193,7 +1193,7 @@ pub(crate) unsafe fn align_offset<T: Sized>(p: *const T, a: usize) -> usize {
     }
 
     // Cannot be aligned at all.
-    usize::max_value()
+    usize::MAX
 }
 
 /// Compares raw pointers for equality.