about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-11-17 16:24:54 +0000
committerbors <bors@rust-lang.org>2024-11-17 16:24:54 +0000
commita8e75c53d0036b5d012cbc0ee5de17f8991fe60c (patch)
treebb4be0dcd1f6f02bd5d244beb6d1b6161f85392b /compiler/rustc_const_eval/src
parent23e7ecb34962ecd069cf28ae7db585e92ca2ee63 (diff)
parentdefc8666a38c115fa46ab4ddb4e3d2eeca3c206c (diff)
downloadrust-a8e75c53d0036b5d012cbc0ee5de17f8991fe60c.tar.gz
rust-a8e75c53d0036b5d012cbc0ee5de17f8991fe60c.zip
Auto merge of #133135 - jieyouxu:rollup-4q1wbyq, r=jieyouxu
Rollup of 6 pull requests

Successful merges:

 - #133029 (ABI checks: add support for some tier3 arches, warn on others.)
 - #133051 (Increase accuracy of `if` condition misparse suggestion)
 - #133060 (Trim whitespace in RemoveLet primary span)
 - #133093 (Let chains tests)
 - #133116 (stabilize const_ptr_is_null)
 - #133126 (alloc: fix `String`'s doc)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_const_eval/src')
-rw-r--r--compiler/rustc_const_eval/src/const_eval/machine.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_const_eval/src/const_eval/machine.rs b/compiler/rustc_const_eval/src/const_eval/machine.rs
index 62115aef4a7..f12320cb851 100644
--- a/compiler/rustc_const_eval/src/const_eval/machine.rs
+++ b/compiler/rustc_const_eval/src/const_eval/machine.rs
@@ -263,6 +263,12 @@ impl<'tcx> CompileTimeInterpCx<'tcx> {
     }
 
     /// See documentation on the `ptr_guaranteed_cmp` intrinsic.
+    /// Returns `2` if the result is unknown.
+    /// Returns `1` if the pointers are guaranteed equal.
+    /// Returns `0` if the pointers are guaranteed inequal.
+    ///
+    /// Note that this intrinsic is exposed on stable for comparison with null. In other words, any
+    /// change to this function that affects comparison with null is insta-stable!
     fn guaranteed_cmp(&mut self, a: Scalar, b: Scalar) -> InterpResult<'tcx, u8> {
         interp_ok(match (a, b) {
             // Comparisons between integers are always known.