reference icon indicating copy to clipboard operation
reference copied to clipboard

Document how extending int-to-ptr and ptr-to-int casts work

Open Rua opened this issue 1 year ago • 0 comments

Judging by the behaviour of Rust in this playground, these casts are treated the same as int-to-int casts, where the pointer is considered equivalent to usize. Casting i32 to usize will sign extend, casting usize to i128 will zero extend.

Rua avatar May 08 '24 07:05 Rua