Skip to content

Commit 81f447e

Browse files
committed
Add links to the new constant expressions section
1 parent d0e6cc7 commit 81f447e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/items.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -715,12 +715,14 @@ More detailed specification for unions, including unstable bits, can be found in
715715

716716
## Constant items
717717

718-
A *constant item* is a named _constant value_ which is not associated with a
718+
A *constant item* is a named _[constant value]_ which is not associated with a
719719
specific memory location in the program. Constants are essentially inlined
720720
wherever they are used, meaning that they are copied directly into the relevant
721721
context when used. References to the same constant are not necessarily
722722
guaranteed to refer to the same memory address.
723723

724+
[constant value]: expressions.html#constant-expressions
725+
724726
Constant values must not have destructors, and otherwise permit most forms of
725727
data. Constants may refer to the address of other constants, in which case the
726728
address will have elided lifetimes where applicable, otherwise – in most cases –

src/tokens.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ grammar as double-quoted strings. Other tokens have exact rules given.
1212
A literal is an expression consisting of a single token, rather than a sequence
1313
of tokens, that immediately and directly denotes the value it evaluates to,
1414
rather than referring to it by name or some other evaluation rule. A literal is
15-
a form of constant expression, so is evaluated (primarily) at compile time.
15+
a form of [constant expression](expressions.html#constant-expressions), so is
16+
evaluated (primarily) at compile time.
1617

1718
### Examples
1819

0 commit comments

Comments
 (0)