From 8b01b71de86967897b05d4854941bf919f61158d Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Wed, 9 Oct 2024 09:59:39 -0700 Subject: [PATCH] Add restriction of the final value of a `const` wrt mutable --- src/items/constant-items.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/items/constant-items.md b/src/items/constant-items.md index f6ba8da73..417f404f0 100644 --- a/src/items/constant-items.md +++ b/src/items/constant-items.md @@ -39,6 +39,8 @@ const BITS_N_STRINGS: BitsNStrings<'static> = BitsNStrings { }; ``` +The final value of a `const` item cannot contain references to anything mutable. + The constant expression may only be omitted in a [trait definition]. ## Constants with Destructors