Skip to content

Commit 49cea27

Browse files
frewsxcvsteveklabnik
authored andcommitted
Paths
1 parent c6275c4 commit 49cea27

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/doc/reference/src/paths.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33
A _path_ is a sequence of one or more path components _logically_ separated by
44
a namespace qualifier (`::`). If a path consists of only one component, it may
5-
refer to either an [item](#items) or a [variable](#variables) in a local control
5+
refer to either an [item] or a [variable] in a local control
66
scope. If a path has multiple components, it refers to an item.
77

8+
[item]: items.html
9+
[variable]: variables.html
10+
811
Every item has a _canonical path_ within its crate, but the path naming an item
912
is only meaningful within a given crate. There is no global namespace across
1013
crates; an item's canonical path merely identifies it within the crate.
@@ -16,16 +19,19 @@ x;
1619
x::y::z;
1720
```
1821

19-
Path components are usually [identifiers](#identifiers), but they may
22+
Path components are usually [identifiers], but they may
2023
also include angle-bracket-enclosed lists of type arguments. In
21-
[expression](#expressions) context, the type argument list is given
24+
[expression] context, the type argument list is given
2225
after a `::` namespace qualifier in order to disambiguate it from a
2326
relational expression involving the less-than symbol (`<`). In type
2427
expression context, the final namespace qualifier is omitted.
2528

29+
[identifiers]: identifiers.html
30+
[expression]: expressions.html
31+
2632
Two examples of paths with type arguments:
2733

28-
```
34+
```rust
2935
# struct HashMap<K, V>(K,V);
3036
# fn f() {
3137
# fn id<T>(t: T) -> T { t }

0 commit comments

Comments
 (0)