From 338b76b250ec7f51a214955b4c128d9392cf0bca Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Tue, 20 Jul 2021 12:59:25 +0200 Subject: [PATCH] Update src/const-safety.md Co-authored-by: Ralf Jung --- src/const-safety.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/const-safety.md b/src/const-safety.md index 8fdbc03..4673196 100644 --- a/src/const-safety.md +++ b/src/const-safety.md @@ -44,7 +44,7 @@ it requires knowing the actual integer address of `S`. 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* 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`), or uninitialized. 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 to `usize` does not actually change the value -- we end up with a local variable of type `usize` whose value is a `Scalar::Ptr`. This is not a problem in