Skip to content

Commit b4a4ccb

Browse files
committed
Constant items - Move links to bottom
1 parent 16c2cc2 commit b4a4ccb

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/items/constant-items.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,17 @@ wherever they are used, meaning that they are copied directly into the relevant
66
context when used. References to the same constant are not necessarily
77
guaranteed to refer to the same memory address.
88

9-
[constant value]: expressions.html#constant-expressions
10-
119
Constant values must not have destructors, and otherwise permit most forms of
1210
data. Constants may refer to the address of other constants, in which case the
1311
address will have elided lifetimes where applicable, otherwise – in most cases
1412
– defaulting to the `static` lifetime. (See below on [static lifetime
1513
elision].) The compiler is, however, still at liberty to translate the constant
1614
many times, so the address referred to may not be stable.
1715

18-
[static lifetime elision]: items/static-items.html#static-lifetime-elision
19-
2016
Constants must be explicitly typed. The type may be any type that doesn't
2117
implement [`Drop`] and has a `'static` lifetime: any references it contains
2218
must have `'static` lifetimes.
2319

24-
[`Drop`]: the-drop-trait.html
25-
2620
```rust
2721
const BIT1: u32 = 1 << 0;
2822
const BIT2: u32 = 1 << 1;
@@ -40,3 +34,7 @@ const BITS_N_STRINGS: BitsNStrings<'static> = BitsNStrings {
4034
mystring: STRING,
4135
};
4236
```
37+
38+
[constant value]: expressions.html#constant-expressions
39+
[static lifetime elision]: items/static-items.html#static-lifetime-elision
40+
[`Drop`]: the-drop-trait.html

0 commit comments

Comments
 (0)