core_intrinsics)Expand description
Compiler intrinsics.
The functions in this module are implementation details of core and should
not be used outside of the standard library. We generally provide access to
intrinsics via stable wrapper functions. Use these instead.
These are the imports making intrinsics available to Rust code. The actual implementations live in the compiler. Some of these intrinsics are lowered to MIR in https://github.com/rust-lang/rust/blob/HEAD/compiler/rustc_mir_transform/src/lower_intrinsics.rs. The remaining intrinsics are implemented for the LLVM backend in https://github.com/rust-lang/rust/blob/HEAD/compiler/rustc_codegen_ssa/src/mir/intrinsic.rs and https://github.com/rust-lang/rust/blob/HEAD/compiler/rustc_codegen_llvm/src/intrinsic.rs, and for const evaluation in https://github.com/rust-lang/rust/blob/HEAD/compiler/rustc_const_eval/src/interpret/intrinsics.rs.
§Const intrinsics
In order to make an intrinsic unstable usable at compile-time, copy the implementation from
https://github.com/rust-lang/miri/blob/master/src/intrinsics to
https://github.com/rust-lang/rust/blob/HEAD/compiler/rustc_const_eval/src/interpret/intrinsics.rs
and make the intrinsic declaration below a const fn. This should be done in coordination with
wg-const-eval.
If an intrinsic is supposed to be used from a const fn with a rustc_const_stable attribute,
#[rustc_intrinsic_const_stable_indirect] needs to be added to the intrinsic. Such a change requires
T-lang approval, because it may bake a feature into the language that cannot be replicated in
user code without compiler support.
§Volatiles
The volatile intrinsics provide operations intended to act on I/O
memory, which are guaranteed to not be reordered by the compiler
across other volatile intrinsics. See read_volatile
and write_volatile.
§Atomics
The atomic intrinsics provide common atomic operations on machine words, with multiple possible memory orderings. See the atomic types docs for details.
§Unwinding
Rust intrinsics may, in general, unwind. If an intrinsic can never unwind, add the
#[rustc_nounwind] attribute so that the compiler can make use of this fact.
However, even for intrinsics that may unwind, rustc assumes that a Rust intrinsics will never initiate a foreign (non-Rust) unwind, and thus for panic=abort we can always assume that these intrinsics cannot unwind.
Modules§
- fallback
Experimental - gpu
Experimental - Intrinsics for GPU targets.
- mir
Experimental - Rustc internal tooling for hand-writing MIR.
- simd
Experimental - SIMD compiler intrinsics.
Enums§
- Atomic
Ordering Experimental validated - A type for atomic ordering parameters for intrinsics. This is a separate type from
atomic::Orderingso that we can make itConstParamTyand fix the values used here without a risk of leaking that to stable code.
Functions§
- copy⚠
Deprecated validated - This is an accidentally-stable alias to
ptr::copy; use that instead. - copy_
nonoverlapping ⚠Deprecated validated - This is an accidentally-stable alias to
ptr::copy_nonoverlapping; use that instead. - transmute⚠
Deprecated validated - Reinterprets the bits of a value of one type as another type.
- write_
bytes ⚠Deprecated validated - This is an accidentally-stable alias to
ptr::write_bytes; use that instead. - abort
Experimental validated - Aborts the execution of the process.
- add_
with_ overflow Experimental validated - Performs checked integer addition.
- aggregate_
raw_ ptr Experimental validated - Lowers in MIR to
Rvalue::AggregatewithAggregateKind::RawPtr. - align_
of Experimental validated - The minimum alignment of a type.
- align_
of_ ⚠val Experimental validated - The required alignment of the referenced value.
- arith_
offset ⚠Experimental validated - Calculates the offset from a pointer, potentially wrapping.
- assert_
inhabited Experimental validated - A guard for unsafe functions that cannot ever be executed if
Tis uninhabited: This will statically either panic, or do nothing. It does not guarantee to ever panic, and should only be called if an assertion failure will imply language UB in the following code. - assert_
mem_ uninitialized_ valid Experimental validated - A guard for
std::mem::uninitialized. This will statically either panic, or do nothing. It does not guarantee to ever panic, and should only be called if an assertion failure will imply language UB in the following code. - assert_
zero_ valid Experimental validated - A guard for unsafe functions that cannot ever be executed if
Tdoes not permit zero-initialization: This will statically either panic, or do nothing. It does not guarantee to ever panic, and should only be called if an assertion failure will imply language UB in the following code. - assume⚠
Experimental validated - Informs the optimizer that a condition is always true. If the condition is false, the behavior is undefined.
- atomic_
and ⚠Experimental validated - Bitwise and with the current value, returning the previous value.
Tmust be an integer or pointer type.Umust be the same asTif that is an integer type, orusizeifTis a pointer type. - atomic_
cxchg ⚠Experimental validated - Stores a value if the current value is the same as the
oldvalue.Tmust be an integer or pointer type. - atomic_
cxchgweak ⚠Experimental validated - Stores a value if the current value is the same as the
oldvalue.Tmust be an integer or pointer type. The comparison may spuriously fail. - atomic_
fence ⚠Experimental validated - An atomic fence.
- atomic_
load ⚠Experimental validated - Loads the current value of the pointer.
Tmust be an integer or pointer type. - atomic_
max ⚠Experimental validated - Maximum with the current value using a signed comparison.
Tmust be a signed integer type. - atomic_
min ⚠Experimental validated - Minimum with the current value using a signed comparison.
Tmust be a signed integer type. - atomic_
nand ⚠Experimental validated - Bitwise nand with the current value, returning the previous value.
Tmust be an integer or pointer type.Umust be the same asTif that is an integer type, orusizeifTis a pointer type. - atomic_
or ⚠Experimental validated - Bitwise or with the current value, returning the previous value.
Tmust be an integer or pointer type.Umust be the same asTif that is an integer type, orusizeifTis a pointer type. - atomic_
singlethreadfence ⚠Experimental validated - An atomic fence for synchronization within a single thread.
- atomic_
store ⚠Experimental validated - Stores the value at the specified memory location.
Tmust be an integer or pointer type. - atomic_
umax ⚠Experimental validated - Maximum with the current value using an unsigned comparison.
Tmust be an unsigned integer type. - atomic_
umin ⚠Experimental validated - Minimum with the current value using an unsigned comparison.
Tmust be an unsigned integer type. - atomic_
xadd ⚠Experimental validated - Adds to the current value, returning the previous value.
Tmust be an integer or pointer type.Umust be the same asTif that is an integer type, orusizeifTis a pointer type. - atomic_
xchg ⚠Experimental validated - Stores the value at the specified memory location, returning the old value.
Tmust be an integer or pointer type. - atomic_
xor ⚠Experimental validated - Bitwise xor with the current value, returning the previous value.
Tmust be an integer or pointer type.Umust be the same asTif that is an integer type, orusizeifTis a pointer type. - atomic_
xsub ⚠Experimental validated - Subtract from the current value, returning the previous value.
Tmust be an integer or pointer type.Umust be the same asTif that is an integer type, orusizeifTis a pointer type. - autodiff
Experimental validated - Generates the LLVM body for the automatic differentiation of
fusing Enzyme, withdfas the derivative function andargsas its arguments. - bitreverse
Experimental validated - Reverses the bits in an integer type
T. - black_
box Experimental validated - See documentation of
std::hint::black_boxfor details. - breakpoint
Experimental validated - Executes a breakpoint trap, for inspection by a debugger.
- bswap
Experimental validated - Reverses the bytes in an integer type
T. - caller_
location Experimental validated - Gets a reference to a static
Locationindicating where it was called. - carrying_
mul_ add Experimental validated - Performs full-width multiplication and addition with a carry:
multiplier * multiplicand + addend + carry. - carryless_
mul Experimental validated - Carryless multiply.
- catch_
unwind ⚠Experimental validated - Rust’s “try catch” construct for unwinding. Invokes the function pointer
try_fnwith the data pointerdata, and callscatch_fnif unwinding occurs whiletry_fnruns. Returns1if unwinding occurred andcatch_fnwas called; returns0otherwise. - ceilf16
Experimental validated - Returns the smallest integer greater than or equal to an
f16. - ceilf32
Experimental validated - Returns the smallest integer greater than or equal to an
f32. - ceilf64
Experimental validated - Returns the smallest integer greater than or equal to an
f64. - ceilf128
Experimental validated - Returns the smallest integer greater than or equal to an
f128. - cold_
path Experimental validated - Hints to the compiler that current code path is cold.
- compare_
bytes ⚠Experimental validated - Lexicographically compare
[left, left + bytes)and[right, right + bytes)as unsigned bytes, returning negative ifleftis less, zero if all the bytes match, or positive ifleftis greater. - const_
allocate ⚠Experimental - Allocates a block of memory at compile time. At runtime, just returns a null pointer.
- const_
deallocate ⚠Experimental - Deallocates a memory which allocated by
intrinsics::const_allocateat compile time. At runtime, it does nothing. - const_
eval_ select Experimental validated - Selects which function to call depending on the context.
- const_
make_ ⚠global Experimental validated - Convert the allocation this pointer points to into immutable global memory. The pointer must point to the beginning of a heap allocation. This operation only makes sense during compile time. At runtime, it does nothing.
- contract_
check_ ensures Experimental - Check if the post-condition
condhas been met. - contract_
check_ requires Experimental - Check if the pre-condition
condhas been met. - copysignf16
Experimental validated - Copies the sign from
ytoxforf16values. - copysignf32
Experimental validated - Copies the sign from
ytoxforf32values. - copysignf64
Experimental validated - Copies the sign from
ytoxforf64values. - copysignf128
Experimental validated - Copies the sign from
ytoxforf128values. - cosf16
Experimental validated - Returns the cosine of an
f16. - cosf32
Experimental validated - Returns the cosine of an
f32. - cosf64
Experimental validated - Returns the cosine of an
f64. - cosf128
Experimental validated - Returns the cosine of an
f128. - ctlz
Experimental validated - Returns the number of leading unset bits (zeroes) in an integer type
T. - ctlz_
nonzero ⚠Experimental validated - Like
ctlz, but extra-unsafe as it returnsundefwhen given anxwith value0. - ctpop
Experimental validated - Returns the number of bits set in an integer type
T - cttz
Experimental validated - Returns the number of trailing unset bits (zeroes) in an integer type
T. - cttz_
nonzero ⚠Experimental validated - Like
cttz, but extra-unsafe as it returnsundefwhen given anxwith value0. - discriminant_
value Experimental validated - Returns the value of the discriminant for the variant in ‘v’;
if
Thas no discriminant, returns0. - disjoint_
bitor ⚠Experimental validated - Combine two values which have no bits in common.
- exact_
div ⚠Experimental validated - Performs an exact division, resulting in undefined behavior where
x % y != 0ory == 0orx == T::MIN && y == -1 - exp2f16
Experimental validated - Returns 2 raised to the power of an
f16. - exp2f32
Experimental validated - Returns 2 raised to the power of an
f32. - exp2f64
Experimental validated - Returns 2 raised to the power of an
f64. - exp2f128
Experimental validated - Returns 2 raised to the power of an
f128. - expf16
Experimental validated - Returns the exponential of an
f16. - expf32
Experimental validated - Returns the exponential of an
f32. - expf64
Experimental validated - Returns the exponential of an
f64. - expf128
Experimental validated - Returns the exponential of an
f128. - fabs
Experimental validated - Returns the absolute value of a floating-point value.
- fadd_
algebraic Experimental validated - Float addition that allows optimizations based on algebraic rules.
- fadd_
fast ⚠Experimental validated - Float addition that allows optimizations based on algebraic rules. Requires that inputs and output of the operation are finite, causing UB otherwise.
- fdiv_
algebraic Experimental validated - Float division that allows optimizations based on algebraic rules.
- fdiv_
fast ⚠Experimental validated - Float division that allows optimizations based on algebraic rules. Requires that inputs and output of the operation are finite, causing UB otherwise.
- field_
offset Experimental validated - The offset of a field queried by its field representing type.
- float_
to_ ⚠int_ unchecked Experimental validated - Converts with LLVM’s fptoui/fptosi, which may return undef for values out of range (https://github.com/rust-lang/rust/issues/10184)
- floorf16
Experimental validated - Returns the largest integer less than or equal to an
f16. - floorf32
Experimental validated - Returns the largest integer less than or equal to an
f32. - floorf64
Experimental validated - Returns the largest integer less than or equal to an
f64. - floorf128
Experimental validated - Returns the largest integer less than or equal to an
f128. - fmaf16
Experimental validated - Returns
a * b + cforf16values. - fmaf32
Experimental validated - Returns
a * b + cforf32values. - fmaf64
Experimental validated - Returns
a * b + cforf64values. - fmaf128
Experimental validated - Returns
a * b + cforf128values. - fmul_
algebraic Experimental validated - Float multiplication that allows optimizations based on algebraic rules.
- fmul_
fast ⚠Experimental validated - Float multiplication that allows optimizations based on algebraic rules. Requires that inputs and output of the operation are finite, causing UB otherwise.
- fmuladdf16
Experimental validated - Returns
a * b + cforf16values, non-deterministically executing either a fused multiply-add or two operations with rounding of the intermediate result. - fmuladdf32
Experimental validated - Returns
a * b + cforf32values, non-deterministically executing either a fused multiply-add or two operations with rounding of the intermediate result. - fmuladdf64
Experimental validated - Returns
a * b + cforf64values, non-deterministically executing either a fused multiply-add or two operations with rounding of the intermediate result. - fmuladdf128
Experimental validated - Returns
a * b + cforf128values, non-deterministically executing either a fused multiply-add or two operations with rounding of the intermediate result. - forget
Experimental validated - Moves a value out of scope without running drop glue.
- frem_
algebraic Experimental validated - Float remainder that allows optimizations based on algebraic rules.
- frem_
fast ⚠Experimental validated - Float remainder that allows optimizations based on algebraic rules. Requires that inputs and output of the operation are finite, causing UB otherwise.
- fsub_
algebraic Experimental validated - Float subtraction that allows optimizations based on algebraic rules.
- fsub_
fast ⚠Experimental validated - Float subtraction that allows optimizations based on algebraic rules. Requires that inputs and output of the operation are finite, causing UB otherwise.
- is_
val_ statically_ known Experimental validated - Returns whether the argument’s value is statically known at compile-time.
- likely
Experimental validated - Hints to the compiler that branch condition is likely to be true. Returns the value passed to it.
- log2f16
Experimental validated - Returns the base 2 logarithm of an
f16. - log2f32
Experimental validated - Returns the base 2 logarithm of an
f32. - log2f64
Experimental validated - Returns the base 2 logarithm of an
f64. - log2f128
Experimental validated - Returns the base 2 logarithm of an
f128. - log10f16
Experimental validated - Returns the base 10 logarithm of an
f16. - log10f32
Experimental validated - Returns the base 10 logarithm of an
f32. - log10f64
Experimental validated - Returns the base 10 logarithm of an
f64. - log10f128
Experimental validated - Returns the base 10 logarithm of an
f128. - logf16
Experimental validated - Returns the natural logarithm of an
f16. - logf32
Experimental validated - Returns the natural logarithm of an
f32. - logf64
Experimental validated - Returns the natural logarithm of an
f64. - logf128
Experimental validated - Returns the natural logarithm of an
f128. - maximum_
number_ nsz_ f16 Experimental - Returns the maximum of two
f16values, ignoring NaN. - maximum_
number_ nsz_ f32 Experimental validated - Returns the maximum of two
f32values, ignoring NaN. - maximum_
number_ nsz_ f64 Experimental - Returns the maximum of two
f64values, ignoring NaN. - maximum_
number_ nsz_ f128 Experimental - Returns the maximum of two
f128values, ignoring NaN. - maximumf16
Experimental - Returns the maximum of two
f16values, propagating NaN. - maximumf32
Experimental - Returns the maximum of two
f32values, propagating NaN. - maximumf64
Experimental - Returns the maximum of two
f64values, propagating NaN. - maximumf128
Experimental - Returns the maximum of two
f128values, propagating NaN. - minimum_
number_ nsz_ f16 Experimental - Returns the minimum of two
f16values, ignoring NaN. - minimum_
number_ nsz_ f32 Experimental validated - Returns the minimum of two
f32values, ignoring NaN. - minimum_
number_ nsz_ f64 Experimental - Returns the minimum of two
f64values, ignoring NaN. - minimum_
number_ nsz_ f128 Experimental - Returns the minimum of two
f128values, ignoring NaN. - minimumf16
Experimental - Returns the minimum of two
f16values, propagating NaN. - minimumf32
Experimental - Returns the minimum of two
f32values, propagating NaN. - minimumf64
Experimental - Returns the minimum of two
f64values, propagating NaN. - minimumf128
Experimental - Returns the minimum of two
f128values, propagating NaN. - mul_
with_ overflow Experimental validated - Performs checked integer multiplication
- needs_
drop Experimental validated - Returns
trueif the actual type given asTrequires drop glue; returnsfalseif the actual type provided forTimplementsCopy. - nontemporal_
store ⚠Experimental validated - Emits a
nontemporalstore, which gives a hint to the CPU that the data should not be held in cache. Except for performance, this is fully equivalent toptr.write(val). - offload
Experimental validated - Generates the LLVM body of a wrapper function to offload a kernel
f. - offset⚠
Experimental validated - Calculates the offset from a pointer.
- offset_
of Experimental validated - The offset of a field inside a type.
- overflow_
checks Experimental validated - Returns whether we should perform some overflow-checking at runtime. This eventually evaluates to
cfg!(overflow_checks), but behaves different fromcfg!when mixing crates built with different flags: if the crate has overflow checks enabled or carries the#[rustc_inherit_overflow_checks]attribute, evaluation is delayed until monomorphization (or until the call gets inlined into a crate that does not delay evaluation further); otherwise it can happen any time. - powf16
Experimental validated - Raises an
f16to anf16power. - powf32
Experimental validated - Raises an
f32to anf32power. - powf64
Experimental validated - Raises an
f64to anf64power. - powf128
Experimental validated - Raises an
f128to anf128power. - powif16
Experimental validated - Raises an
f16to an integer power. - powif32
Experimental validated - Raises an
f32to an integer power. - powif64
Experimental validated - Raises an
f64to an integer power. - powif128
Experimental validated - Raises an
f128to an integer power. - prefetch_
read_ data Experimental - The
prefetchintrinsic is a hint to the code generator to insert a prefetch instruction for the given address if supported; otherwise, it is a no-op. Prefetches have no effect on the behavior of the program but can change its performance characteristics. - prefetch_
read_ instruction Experimental - The
prefetchintrinsic is a hint to the code generator to insert a prefetch instruction for the given address if supported; otherwise, it is a no-op. Prefetches have no effect on the behavior of the program but can change its performance characteristics. - prefetch_
write_ data Experimental - The
prefetchintrinsic is a hint to the code generator to insert a prefetch instruction for the given address if supported; otherwise, it is a no-op. Prefetches have no effect on the behavior of the program but can change its performance characteristics. - prefetch_
write_ instruction Experimental - The
prefetchintrinsic is a hint to the code generator to insert a prefetch instruction for the given address if supported; otherwise, it is a no-op. Prefetches have no effect on the behavior of the program but can change its performance characteristics. - ptr_
guaranteed_ cmp Experimental validated - See documentation of
<*const T>::guaranteed_eqfor details. Returns2if the result is unknown. Returns1if the pointers are guaranteed equal. Returns0if the pointers are guaranteed inequal. - ptr_
mask Experimental validated - Masks out bits of the pointer according to a mask.
- ptr_
metadata Experimental validated - Lowers in MIR to
Rvalue::UnaryOpwithUnOp::PtrMetadata. - ptr_
offset_ ⚠from Experimental validated - See documentation of
<*const T>::offset_fromfor details. - ptr_
offset_ ⚠from_ unsigned Experimental validated - See documentation of
<*const T>::offset_from_unsignedfor details. - raw_eq⚠
Experimental validated - Determines whether the raw bytes of the two values are equal.
- read_
via_ ⚠copy Experimental validated - This is an implementation detail of
crate::ptr::readand should not be used anywhere else. See its comments for why this exists. - rotate_
left Experimental validated - Performs rotate left.
- rotate_
right Experimental validated - Performs rotate right.
- round_
ties_ even_ f16 Experimental validated - Returns the nearest integer to an
f16. Rounds half-way cases to the number with an even least significant digit. - round_
ties_ even_ f32 Experimental validated - Returns the nearest integer to an
f32. Rounds half-way cases to the number with an even least significant digit. - round_
ties_ even_ f64 Experimental validated - Returns the nearest integer to an
f64. Rounds half-way cases to the number with an even least significant digit. - round_
ties_ even_ f128 Experimental validated - Returns the nearest integer to an
f128. Rounds half-way cases to the number with an even least significant digit. - roundf16
Experimental validated - Returns the nearest integer to an
f16. Rounds half-way cases away from zero. - roundf32
Experimental validated - Returns the nearest integer to an
f32. Rounds half-way cases away from zero. - roundf64
Experimental validated - Returns the nearest integer to an
f64. Rounds half-way cases away from zero. - roundf128
Experimental validated - Returns the nearest integer to an
f128. Rounds half-way cases away from zero. - rustc_
peek Experimental validated - Magic intrinsic that derives its meaning from attributes attached to the function.
- saturating_
add Experimental validated - Computes
a + b, saturating at numeric bounds. - saturating_
sub Experimental validated - Computes
a - b, saturating at numeric bounds. - select_
unpredictable Experimental validated - Returns either
true_valorfalse_valdepending on conditionbwith a hint to the compiler that this condition is unlikely to be correctly predicted by a CPU’s branch predictor (e.g. a binary search). - sinf16
Experimental validated - Returns the sine of an
f16. - sinf32
Experimental validated - Returns the sine of an
f32. - sinf64
Experimental validated - Returns the sine of an
f64. - sinf128
Experimental validated - Returns the sine of an
f128. - size_of
Experimental validated - The size of a type in bytes.
- size_
of_ ⚠val Experimental validated - The size of the referenced value in bytes.
- slice_
get_ ⚠unchecked Experimental validated - Projects to the
index-th element ofslice_ptr, as the same kind of pointer as the slice was provided – so&mut [T] → &mut T,&[T] → &T,*mut [T] → *mut T, or*const [T] → *const T– without a bounds check. - sqrtf16
Experimental validated - Returns the square root of an
f16 - sqrtf32
Experimental validated - Returns the square root of an
f32 - sqrtf64
Experimental validated - Returns the square root of an
f64 - sqrtf128
Experimental validated - Returns the square root of an
f128 - sub_
with_ overflow Experimental validated - Performs checked integer subtraction
- three_
way_ compare Experimental validated - Does a three-way comparison between the two arguments, which must be of character or integer (signed or unsigned) type.
- transmute_
unchecked ⚠Experimental validated - Like
transmute, but even less checked at compile-time: rather than giving an error forsize_of::<Src>() != size_of::<Dst>(), it’s Undefined Behavior at runtime. - truncf16
Experimental validated - Returns the integer part of an
f16. - truncf32
Experimental validated - Returns the integer part of an
f32. - truncf64
Experimental validated - Returns the integer part of an
f64. - truncf128
Experimental validated - Returns the integer part of an
f128. - type_id
Experimental validated - Gets an identifier which is globally unique to the specified type. This function will return the same value for a type regardless of whichever crate it is invoked in.
- type_
id_ eq Experimental validated - Tests (at compile-time) if two
crate::any::TypeIdinstances identify the same type. This is necessary because at const-eval time the actual discriminating data is opaque and cannot be inspected directly. - type_
id_ vtable Experimental - Check if a type represented by a
TypeIdimplements a trait represented by aTypeId. It can only be called at compile time, the backends do not implement it. If it implements the trait the dyn metadata gets returned for vtable access. - type_
name Experimental validated - Gets a static string slice containing the name of a type.
- type_of
Experimental - Compute the type information of a concrete type. It can only be called at compile time, the backends do not implement it.
- typed_
swap_ ⚠nonoverlapping Experimental validated - Non-overlapping typed swap of a single value.
- ub_
checks Experimental validated - Returns whether we should perform some UB-checking at runtime. This eventually evaluates to
cfg!(ub_checks), but behaves different fromcfg!when mixing crates built with different flags: if the crate has UB checks enabled or carries the#[rustc_preserve_ub_checks]attribute, evaluation is delayed until monomorphization (or until the call gets inlined into a crate that does not delay evaluation further); otherwise it can happen any time. - unaligned_
volatile_ ⚠load Experimental validated - Performs a volatile load from the
srcpointer The pointer is not required to be aligned. - unaligned_
volatile_ ⚠store Experimental validated - Performs a volatile store to the
dstpointer. The pointer is not required to be aligned. - unchecked_
add ⚠Experimental validated - Returns the result of an unchecked addition, resulting in
undefined behavior when
x + y > T::MAXorx + y < T::MIN. - unchecked_
div ⚠Experimental validated - Performs an unchecked division, resulting in undefined behavior
where
y == 0orx == T::MIN && y == -1 - unchecked_
funnel_ ⚠shl Experimental validated - Funnel Shift left.
- unchecked_
funnel_ ⚠shr Experimental validated - Funnel Shift right.
- unchecked_
mul ⚠Experimental validated - Returns the result of an unchecked multiplication, resulting in
undefined behavior when
x * y > T::MAXorx * y < T::MIN. - unchecked_
rem ⚠Experimental validated - Returns the remainder of an unchecked division, resulting in
undefined behavior when
y == 0orx == T::MIN && y == -1 - unchecked_
shl ⚠Experimental validated - Performs an unchecked left shift, resulting in undefined behavior when
y < 0ory >= N, where N is the width of T in bits. - unchecked_
shr ⚠Experimental validated - Performs an unchecked right shift, resulting in undefined behavior when
y < 0ory >= N, where N is the width of T in bits. - unchecked_
sub ⚠Experimental validated - Returns the result of an unchecked subtraction, resulting in
undefined behavior when
x - y > T::MAXorx - y < T::MIN. - unlikely
Experimental validated - Hints to the compiler that branch condition is likely to be false. Returns the value passed to it.
- unreachable⚠
Experimental validated - Informs the optimizer that this point in the code is not reachable, enabling further optimizations.
- va_arg⚠
Experimental validated - Loads an argument of type
Tfrom theva_listapand increment the argumentappoints to. - va_copy
Experimental - Duplicates a variable argument list. The returned list is initially at the same position as
the one in
src, but can be advanced independently. - va_end⚠
Experimental - Destroy the variable argument list
apafter initialization withva_start(part of the desugaring of...) orva_copy. - variant_
count Experimental validated - Returns the number of variants of the type
Tcast to ausize; ifThas no variants, returns0. Uninhabited variants will be counted. - volatile_
copy_ ⚠memory Experimental validated - Equivalent to the appropriate
llvm.memmove.p0i8.0i8.*intrinsic, with a size ofcount * size_of::<T>()and an alignment ofalign_of::<T>(). - volatile_
copy_ ⚠nonoverlapping_ memory Experimental validated - Equivalent to the appropriate
llvm.memcpy.p0i8.0i8.*intrinsic, with a size ofcount*size_of::<T>()and an alignment ofalign_of::<T>(). - volatile_
load ⚠Experimental validated - Performs a volatile load from the
srcpointer. - volatile_
set_ ⚠memory Experimental validated - Equivalent to the appropriate
llvm.memset.p0i8.*intrinsic, with a size ofcount * size_of::<T>()and an alignment ofalign_of::<T>(). - volatile_
store ⚠Experimental validated - Performs a volatile store to the
dstpointer. - vtable_
align ⚠Experimental validated - The intrinsic will return the alignment stored in that vtable.
- vtable_
size ⚠Experimental validated - The intrinsic will return the size stored in that vtable.
- wrapping_
add Experimental validated - Returns (a + b) mod 2N, where N is the width of T in bits.
- wrapping_
mul Experimental validated - Returns (a * b) mod 2N, where N is the width of T in bits.
- wrapping_
sub Experimental validated - Returns (a - b) mod 2N, where N is the width of T in bits.
- write_
via_ ⚠move Experimental validated - This is an implementation detail of
crate::ptr::writeand should not be used anywhere else. See its comments for why this exists.