Skip to content

Commit f37173d

Browse files
committed
Add example use of rule in link definition
On the introduction page, where we talk about rule identifiers, let's add an example use of putting the rule identifier in the link definition so that we have an easy way of verifying that this mechanism works as intended.
1 parent 6e7ab3e commit f37173d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/introduction.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ These conventions are documented here.
116116
See [Notation] for more detail.
117117

118118
r[example.rule.label]
119-
* Rule identifiers appear before each language rule enclosed in square brackets. These identifiers provide a way to refer to a specific rule in the language. The rule identifier uses periods to separate sections from most general to most specific ([destructors.scope.nesting.function-body] for example). On narrow screens, the rule name will collapse to display `[*]`.
119+
* Rule identifiers appear before each language rule enclosed in square brackets. These identifiers provide a way to refer to and link to a specific rule in the language ([e.g.][example rule]). The rule identifier uses periods to separate sections from most general to most specific ([destructors.scope.nesting.function-body] for example). On narrow screens, the rule name will collapse to display `[*]`.
120120

121121
The rule name can be clicked to link to that rule.
122122

@@ -144,6 +144,7 @@ We also want the reference to be as normative as possible, so if you see anythin
144144
[_Expression_]: expressions.md
145145
[cargo book]: ../cargo/index.html
146146
[cargo reference]: ../cargo/reference/index.html
147+
[example rule]: example.rule.label
147148
[expressions chapter]: expressions.html
148149
[file an issue]: https://github.com/rust-lang/reference/issues
149150
[lifetime of temporaries]: expressions.html#temporaries

0 commit comments

Comments
 (0)