Update src/const-safety.md

Co-authored-by: Ralf Jung <post@ralfj.de>
pull/221/head
Oliver Scherer 4 years ago committed by GitHub
parent 74c65981a5
commit 3483826000
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -43,7 +43,7 @@ it requires knowing the actual integer address of `S`.
The way miri handles this is by treating pointer and integer values separately. The way miri handles this is by treating pointer and integer values separately.
The most primitive kind of value in miri is a `Scalar`, and a scalar is *either* The most primitive kind of value in miri is a `Scalar`, and a scalar is *either*
a pointer (`Scalar::Ptr`) or a bunch of bits representing an integer a pointer (`Scalar::Ptr`) *or* a bunch of bits representing an integer
(`Scalar::Bits`). Every value of a variable of primitive type is stored as a (`Scalar::Bits`). Every value of a variable of primitive type is stored as a
`Scalar`. In the code above, casting the pointer `&S` to `*const i32` and then `Scalar`. In the code above, casting the pointer `&S` to `*const i32` and then
to `usize` does not actually change the value -- we end up with a local variable to `usize` does not actually change the value -- we end up with a local variable

Loading…
Cancel
Save