Skip to content
ZOLO / TE844 Type · error

unsafe bitcast requires equal-size numeric layouts

`unsafe bitcast::<T>(value)` reinterprets representation bits rather than performing a numeric or domain conversion, so both types must be fixed-width numeric types with exactly the same bit width. Use `as?`, `cast::<T>(policy)`, `into`, or `try_into` to actually change the value instead.

unsafe bitcast::<T>(value) reinterprets representation bits; it does not perform a numeric or domain conversion. Both types must be fixed-width numeric types with exactly the same number of bits.

let bits = unsafe bitcast::<u32>(1.0f32)
let value = unsafe bitcast::<f32>(bits)

Use as?, cast::<T>(policy), into, or try_into when the intent is to change the value rather than reinterpret its representation.

Global index

Find your way through Zolo

Try an idea

Start here

9 results

9 results

enespt-br