Skip to content

Commit 3557e69

Browse files
committed
Link to references section when they first appear
In a straight-through read of "Syntax and Semantics," the concept of a "reference" is used here before it is explained. Mention that and link to the section explaining references.
1 parent e22ceea commit 3557e69

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/doc/book/primitive-types.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,11 @@ variable binding. Slices have a defined length, can be mutable or immutable.
167167
## Slicing syntax
168168

169169
You can use a combo of `&` and `[]` to create a slice from various things. The
170-
`&` indicates that slices are similar to references, and the `[]`s, with a
171-
range, let you define the length of the slice:
170+
`&` indicates that slices are similar to [references][], which we will cover in
171+
detail later in this section. The `[]`s, with a range, let you define the
172+
length of the slice:
173+
174+
[references]: references-and-borrowing.html
172175

173176
```rust
174177
let a = [0, 1, 2, 3, 4];

0 commit comments

Comments
 (0)