You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: library/core/src/arch.rs
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -80,13 +80,17 @@ pub fn breakpoint() {
80
80
/// The `core::arch::return_address!()` macro returns a pointer with an address that corresponds to the caller of the function that invoked the `return_address!()` macro.
81
81
/// The pointer has no provenance, as if created by `core::ptr::without_provenance`. It cannot be used to read memory (other than ZSTs).
82
82
///
83
-
/// The value returned by the macro depends highly on the architecture and compiler (including any options set).
84
-
/// In particular, it is allowed to be wrong (particularly if inlining is involved), or even contain a nonsense value.
83
+
/// The value returned by the macro depends highly on the architecture and compiler (including any options set).
84
+
/// In particular, it is allowed to be wrong (particularly if inlining is involved), or even contain a nonsense value.
85
85
/// The result of this macro must not be relied upon for soundness or correctness, only for debugging purposes.
86
+
///
87
+
/// As a best effort, if a useful value cannot be determined (for example, due to limitations on the current codegen),
88
+
/// this macro tries to return a null pointer instead of nonsense (this cannot be relied upon for correctness, however).
89
+
///
86
90
/// Formally, this function returns a pointer with a non-deterministic address and no provenance.
87
-
/// As a best effort, if a useful value cannot be determined (for example, due to limitations on the current codegen), this macro tries to return a null pointer instead of nonsense (this cannot be relied upon for correctness, however).
88
91
///
89
-
/// This is equivalent to the gcc `__builtin_return_address(0)` intrinsic (other forms of the intrinsic are not supported). Because the operation can be always performed by the compiler without crashing or causing undefined behaviour, invoking the macro is a safe operation.
92
+
/// This is equivalent to the gcc `__builtin_return_address(0)` intrinsic (other forms of the intrinsic are not supported).
93
+
/// Because the operation can be always performed by the compiler without crashing or causing undefined behaviour, invoking the macro is a safe operation.
0 commit comments