Commit 0587f3e 1 parent a193ed9 commit 0587f3e Copy full SHA for 0587f3e
File tree 2 files changed +22
-16
lines changed
2 files changed +22
-16
lines changed Original file line number Diff line number Diff line change @@ -12,14 +12,17 @@ impl<T: ?Sized> *const T {
12
12
/// Therefore, two pointers that are null may still not compare equal to
13
13
/// each other.
14
14
///
15
- /// ## Behavior during const evaluation
16
- ///
17
- /// When this function is used during const evaluation, it may return `false` for pointers
18
- /// that turn out to be null at runtime. Specifically, when a pointer to some memory
19
- /// is offset beyond its bounds in such a way that the resulting pointer is null,
20
- /// the function will still return `false`. There is no way for CTFE to know
21
- /// the absolute position of that memory, so we cannot tell if the pointer is
22
- /// null or not.
15
+ /// # Panics during const evaluation
16
+ ///
17
+ /// If this method is used during const evaluation, and `self` is a pointer
18
+ /// that is offset beyond the bounds of the memory it initially pointed to,
19
+ /// then there might not be enough information to determine whether the
20
+ /// pointer is null. This is because the absolute address in memory is not
21
+ /// known at compile time. If the nullness of the pointer cannot be
22
+ /// determined, this method will panic.
23
+ ///
24
+ /// In-bounds pointers are never null, so the method will never panic for
25
+ /// such pointers.
23
26
///
24
27
/// # Examples
25
28
///
Original file line number Diff line number Diff line change @@ -12,14 +12,17 @@ impl<T: ?Sized> *mut T {
12
12
/// Therefore, two pointers that are null may still not compare equal to
13
13
/// each other.
14
14
///
15
- /// ## Behavior during const evaluation
16
- ///
17
- /// When this function is used during const evaluation, it may return `false` for pointers
18
- /// that turn out to be null at runtime. Specifically, when a pointer to some memory
19
- /// is offset beyond its bounds in such a way that the resulting pointer is null,
20
- /// the function will still return `false`. There is no way for CTFE to know
21
- /// the absolute position of that memory, so we cannot tell if the pointer is
22
- /// null or not.
15
+ /// # Panics during const evaluation
16
+ ///
17
+ /// If this method is used during const evaluation, and `self` is a pointer
18
+ /// that is offset beyond the bounds of the memory it initially pointed to,
19
+ /// then there might not be enough information to determine whether the
20
+ /// pointer is null. This is because the absolute address in memory is not
21
+ /// known at compile time. If the nullness of the pointer cannot be
22
+ /// determined, this method will panic.
23
+ ///
24
+ /// In-bounds pointers are never null, so the method will never panic for
25
+ /// such pointers.
23
26
///
24
27
/// # Examples
25
28
///
You can’t perform that action at this time.
0 commit comments