Skip to content

Commit 1eb544a

Browse files
committed
Convert remaining grammar rule references to links
In rust-lang#1787 I missed linkify-ing references to grammar rules that weren't links. This makes sure that they are linked and validated.
1 parent 252904b commit 1eb544a

File tree

9 files changed

+24
-24
lines changed

9 files changed

+24
-24
lines changed

src/attributes.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ r[attributes.meta]
110110
## Meta Item Attribute Syntax
111111

112112
r[attributes.meta.intro]
113-
A "meta item" is the syntax used for the _Attr_ rule by most [built-in
113+
A "meta item" is the syntax used for the [Attr] rule by most [built-in
114114
attributes]. It has the following grammar:
115115

116116
r[attributes.meta.syntax]
@@ -185,11 +185,11 @@ Some examples of meta items are:
185185

186186
Style | Example
187187
------|--------
188-
_MetaWord_ | `no_std`
189-
_MetaNameValueStr_ | `doc = "example"`
190-
_MetaListPaths_ | `allow(unused, clippy::inline_always)`
191-
_MetaListIdents_ | `macro_use(foo, bar)`
192-
_MetaListNameValueStr_ | `link(name = "CoreFoundation", kind = "framework")`
188+
[MetaWord] | `no_std`
189+
[MetaNameValueStr] | `doc = "example"`
190+
[MetaListPaths] | `allow(unused, clippy::inline_always)`
191+
[MetaListIdents] | `macro_use(foo, bar)`
192+
[MetaListNameValueStr] | `link(name = "CoreFoundation", kind = "framework")`
193193

194194
r[attributes.activity]
195195
## Active and inert attributes

src/expressions/range-expr.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ The `..` and `..=` operators will construct an object of one of the `std::ops::R
3030

3131
| Production | Syntax | Type | Range |
3232
|------------------------|---------------|------------------------------|-----------------------|
33-
| _RangeExpr_ | start`..`end | [std::ops::Range] | start ≤ x < end |
34-
| _RangeFromExpr_ | start`..` | [std::ops::RangeFrom] | start ≤ x |
35-
| _RangeToExpr_ | `..`end | [std::ops::RangeTo] | x < end |
36-
| _RangeFullExpr_ | `..` | [std::ops::RangeFull] | - |
37-
| _RangeInclusiveExpr_ | start`..=`end | [std::ops::RangeInclusive] | start ≤ x ≤ end |
38-
| _RangeToInclusiveExpr_ | `..=`end | [std::ops::RangeToInclusive] | x ≤ end |
33+
| [RangeExpr] | start`..`end | [std::ops::Range] | start ≤ x < end |
34+
| [RangeFromExpr] | start`..` | [std::ops::RangeFrom] | start ≤ x |
35+
| [RangeToExpr] | `..`end | [std::ops::RangeTo] | x < end |
36+
| [RangeFullExpr] | `..` | [std::ops::RangeFull] | - |
37+
| [RangeInclusiveExpr] | start`..=`end | [std::ops::RangeInclusive] | start ≤ x ≤ end |
38+
| [RangeToInclusiveExpr] | `..=`end | [std::ops::RangeToInclusive] | x ≤ end |
3939

4040
Examples:
4141

src/identifiers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Zero width non-joiner (ZWNJ U+200C) and zero width joiner (ZWJ U+200D) character
5151
r[ident.ascii-limitations]
5252
Identifiers are restricted to the ASCII subset of [`XID_Start`] and [`XID_Continue`] in the following situations:
5353

54-
* [`extern crate`] declarations (except the _AsClause_ identifier)
54+
* [`extern crate`] declarations (except the [AsClause] identifier)
5555
* External crate names referenced in a [path]
5656
* [Module] names loaded from the filesystem without a [`path` attribute]
5757
* [`no_mangle`] attributed items

src/items/functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ fn first((value, _): (i32, i32)) -> i32 { value }
8383
```
8484

8585
r[items.fn.params.self-pat]
86-
If the first parameter is a _SelfParam_, this indicates that the function is a
86+
If the first parameter is a [SelfParam], this indicates that the function is a
8787
[method].
8888

8989
r[items.fn.params.self-restriction]

src/items/generics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ r[items.generics.syntax.decl-order]
2727
The order of generic parameters is restricted to lifetime parameters and then type and const parameters intermixed.
2828

2929
r[items.generics.syntax.duplicate-params]
30-
The same parameter name may not be declared more than once in a _GenericParams_ list.
30+
The same parameter name may not be declared more than once in a [GenericParams] list.
3131

3232
Some examples of items with type, const, and lifetime parameters:
3333

src/macros.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ r[macro.invocation.extern]
5858
* [External blocks]
5959

6060
r[macro.invocation.item-statement]
61-
When used as an item or a statement, the _MacroInvocationSemi_ form is used
61+
When used as an item or a statement, the [MacroInvocationSemi] form is used
6262
where a semicolon is required at the end when not using curly braces.
6363
[Visibility qualifiers] are never allowed before a macro invocation or
6464
[`macro_rules`] definition.

src/paths.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ and qualified paths.
153153

154154
r[paths.type.turbofish]
155155
Although the `::` token is allowed before the generics arguments, it is not required
156-
because there is no ambiguity like there is in _PathInExpression_.
156+
because there is no ambiguity like there is in [PathInExpression].
157157

158158
```rust
159159
# mod ops {

src/patterns.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ RangePatternBound ->
489489
| PathExpression
490490
```
491491

492-
[^obsolete-range-edition]: The _ObsoleteRangePattern_ syntax has been removed in the 2021 edition.
492+
[^obsolete-range-edition]: The [ObsoleteRangePattern] syntax has been removed in the 2021 edition.
493493

494494
r[patterns.range.intro]
495495
*Range patterns* match scalar values within the range defined by their bounds.
@@ -648,7 +648,7 @@ r[patterns.range.refutable-char]
648648
The range of values for a `char` type are precisely those ranges containing all Unicode Scalar Values: `'\u{0000}'..='\u{D7FF}'` and `'\u{E000}'..='\u{10FFFF}'`.
649649

650650
r[patterns.range.constraint-slice]
651-
_RangeFromPattern_ cannot be used as a top-level pattern for subpatterns in [slice patterns](#slice-patterns).
651+
[RangeFromPattern] cannot be used as a top-level pattern for subpatterns in [slice patterns](#slice-patterns).
652652
For example, the pattern `[1.., _]` is not a valid pattern.
653653

654654
r[patterns.range.edition2021]
@@ -785,7 +785,7 @@ r[patterns.struct.constraint-union]
785785
A struct pattern used to match a union must specify exactly one field (see [Pattern matching on unions]).
786786

787787
r[patterns.struct.binding-shorthand]
788-
The `ref` and/or `mut` _IDENTIFIER_ syntax matches any value and binds it to a variable with the same name as the given field.
788+
The `ref` and/or `mut` [IDENTIFIER] syntax matches any value and binds it to a variable with the same name as the given field.
789789

790790
```rust
791791
# struct Struct {
@@ -799,7 +799,7 @@ let Struct{a: x, b: y, c: z} = struct_value; // destructure all fields
799799
```
800800

801801
r[patterns.struct.refutable]
802-
A struct pattern is refutable if the _PathInExpression_ resolves to a constructor of an enum with more than one variant, or one of its subpatterns is refutable.
802+
A struct pattern is refutable if the [PathInExpression] resolves to a constructor of an enum with more than one variant, or one of its subpatterns is refutable.
803803

804804
r[patterns.tuple-struct]
805805
## Tuple struct patterns
@@ -816,7 +816,7 @@ Tuple struct patterns match tuple struct and enum values that match all criteria
816816
They are also used to [destructure](#destructuring) a tuple struct or enum value.
817817

818818
r[patterns.tuple-struct.refutable]
819-
A tuple struct pattern is refutable if the _PathInExpression_ resolves to a constructor of an enum with more than one variant, or one of its subpatterns is refutable.
819+
A tuple struct pattern is refutable if the [PathInExpression] resolves to a constructor of an enum with more than one variant, or one of its subpatterns is refutable.
820820

821821
r[patterns.tuple]
822822
## Tuple patterns
@@ -985,7 +985,7 @@ r[patterns.or]
985985

986986
_Or-patterns_ are patterns that match on one of two or more sub-patterns (for example `A | B | C`).
987987
They can nest arbitrarily.
988-
Syntactically, or-patterns are allowed in any of the places where other patterns are allowed (represented by the _Pattern_ production), with the exceptions of `let`-bindings and function and closure arguments (represented by the _PatternNoTopAlt_ production).
988+
Syntactically, or-patterns are allowed in any of the places where other patterns are allowed (represented by the [Pattern] production), with the exceptions of `let`-bindings and function and closure arguments (represented by the [PatternNoTopAlt] production).
989989

990990
r[patterns.constraints]
991991
### Static semantics

src/types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ TypeNoBounds ->
6969
```
7070

7171
r[type.name.intro]
72-
A _type expression_ as defined in the _Type_ grammar rule above is the syntax
72+
A _type expression_ as defined in the [Type] grammar rule above is the syntax
7373
for referring to a type. It may refer to:
7474

7575
r[type.name.sequence]

0 commit comments

Comments
 (0)