From b63c1268d88b1e8a8c036d6b188460cd0d5ae18d Mon Sep 17 00:00:00 2001 From: Oliver Scherer Date: Sat, 20 Jun 2020 15:56:13 +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 e8e7a8e..a9f75b2 100644 --- a/src/const-safety.md +++ b/src/const-safety.md @@ -53,7 +53,7 @@ itself, but then executing `%` on this *pointer value* is unsupported. However, it does not seem appropriate to blame the `%` operation above for this failure. `%` on "normal" `usize` values (`Scalar::Bits`) is perfectly fine, just using it on values computed from pointers is an issue. Essentially, `&i32 as *const i32 as -usize` is a "safe" `usize` at run-time (meaning that applying safe operations to +usize` computes a "safe" `usize` at run-time (meaning that applying safe operations to this `usize` cannot lead to misbehavior, following terminology [suggested here]) -- but the same value is *not* "safe" at compile-time, because we can cause a const safety violation by applying a safe operation (namely, `%`).