From b086fc0acd3bde668f88d69b3d883c531323898e Mon Sep 17 00:00:00 2001 From: Ding Xiang Fei Date: Tue, 3 Dec 2024 03:59:00 +0800 Subject: [PATCH] apply suggestions --- src/const_eval.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/const_eval.md b/src/const_eval.md index 6f8254bc5..52ae2e362 100644 --- a/src/const_eval.md +++ b/src/const_eval.md @@ -42,13 +42,16 @@ r[const-eval.const-expr.path-item] Recursively defining constants is not allowed. r[const-eval.const-expr.path-static] -* Paths to [statics] with these restrictions and observations. +* Paths to [statics] with these restrictions. * Writes to `static` items are not allowed in any constant evaluation context. * Reads from `extern` statics are not allowed in any constant evaluation context. * If the evaluation is *not* carried out in an initializer of a `static` item, then reads from any mutable `static` are not allowed. A mutable `static` is a `static mut` item, or a `static` item with an interior-mutable type. +These requirements are checked only when the constant is evaluated. +In other words, having such accessed syntactically occur in const contexts is allowed as long as they never get executed. + r[const-eval.const-expr.tuple] * [Tuple expressions].