File tree 2 files changed +20
-12
lines changed
2 files changed +20
-12
lines changed Original file line number Diff line number Diff line change @@ -14,12 +14,16 @@ impl<T: ?Sized> *const T {
14
14
///
15
15
/// ## Behavior during const evaluation
16
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.
17
+ /// When this function is used during const evaluation, this function will
18
+ /// panic if CTFE cannot determine whether the pointer is null or not. This
19
+ /// panic might or might not occur when `self` is a pointer that is offset
20
+ /// beyond the bounds of the memory it initially pointed to. Conversely,
21
+ /// this panic will never occur when `self` is in-bounds.
22
+ ///
23
+ /// This inability to determine nullness occurs because there is no way for
24
+ /// CTFE to know the absolute position of that memory, so it might or might
25
+ /// not be possible to determine whether an offset out of bounds happens to
26
+ /// result in a null pointer.
23
27
///
24
28
/// # Examples
25
29
///
Original file line number Diff line number Diff line change @@ -14,12 +14,16 @@ impl<T: ?Sized> *mut T {
14
14
///
15
15
/// ## Behavior during const evaluation
16
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.
17
+ /// When this function is used during const evaluation, this function will
18
+ /// panic if CTFE cannot determine whether the pointer is null or not. This
19
+ /// panic might or might not occur when `self` is a pointer that is offset
20
+ /// beyond the bounds of the memory it initially pointed to. Conversely,
21
+ /// this panic will never occur when `self` is in-bounds.
22
+ ///
23
+ /// This inability to determine nullness occurs because there is no way for
24
+ /// CTFE to know the absolute position of that memory, so it might or might
25
+ /// not be possible to determine whether an offset out of bounds happens to
26
+ /// result in a null pointer.
23
27
///
24
28
/// # Examples
25
29
///
You can’t perform that action at this time.
0 commit comments