Skip to content

Commit

Permalink
Add restriction of the final value of a const wrt mutable
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Oct 9, 2024
1 parent 73de72e commit 8b01b71
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/items/constant-items.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8b01b71

Please sign in to comment.