Skip to content

Commit 5238a8f

Browse files
authored
Merge pull request #1851 from ehuss/fix-grammar-links
Fix grammar links
2 parents d4c66b3 + 1eb544a commit 5238a8f

File tree

12 files changed

+30
-39
lines changed

12 files changed

+30
-39
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/attributes/codegen.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -643,9 +643,7 @@ r[attributes.codegen.instruction_set.behavior]
643643
This allows mixing more than one instruction set in a single program on CPU architectures that support it.
644644

645645
r[attributes.codegen.instruction_set.syntax]
646-
It uses the [_MetaListPath_] syntax, and a path comprised of the architecture family name and instruction set name.
647-
648-
[_MetaListPath_]: ../attributes.md#meta-item-attribute-syntax
646+
It uses the [MetaListPaths] syntax, and a path comprised of the architecture family name and instruction set name.
649647

650648
r[attributes.codegen.instruction_set.target-limits]
651649
It is a compilation error to use the `instruction_set` attribute on a target that does not support it.

src/expressions/if-expr.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The syntax of an `if` expression is a sequence of one or more condition operands
3535
followed by a consequent block, any number of `else if` conditions and blocks, and an optional trailing `else` block.
3636

3737
r[expr.if.condition]
38-
Condition operands must be either an [_Expression_] with a [boolean type] or a conditional `let` match.
38+
Condition operands must be either an [Expression] with a [boolean type] or a conditional `let` match.
3939

4040
r[expr.if.condition-true]
4141
If all of the condition operands evaluate to `true` and all of the `let` patterns successfully match their [scrutinee]s,
@@ -125,7 +125,7 @@ r[expr.if.chains.intro]
125125
Multiple condition operands can be separated with `&&`.
126126

127127
r[expr.if.chains.order]
128-
Similar to a `&&` [_LazyBooleanOperatorExpression_], each operand is evaluated from left-to-right until an operand evaluates as `false` or a `let` match fails,
128+
Similar to a `&&` [LazyBooleanExpression], each operand is evaluated from left-to-right until an operand evaluates as `false` or a `let` match fails,
129129
in which case the subsequent operands are not evaluated.
130130

131131
r[expr.if.chains.bindings]
@@ -163,7 +163,7 @@ fn nested() {
163163
```
164164

165165
r[expr.if.chains.or]
166-
If any condition operand is a `let` pattern, then none of the condition operands can be a `||` [lazy boolean operator expression][_LazyBooleanOperatorExpression_] due to ambiguity and precedence with the `let` scrutinee.
166+
If any condition operand is a `let` pattern, then none of the condition operands can be a `||` [lazy boolean operator expression][expr.bool-logic] due to ambiguity and precedence with the `let` scrutinee.
167167
If a `||` expression is needed, then parentheses can be used. For example:
168168

169169
```rust
@@ -178,11 +178,6 @@ r[expr.if.edition2024]
178178
> [!EDITION-2024]
179179
> Before the 2024 edition, let chains are not supported. That is, the [LetChain] grammar is not allowed in an `if` expression.
180180
181-
[_BlockExpression_]: block-expr.md
182-
[_Expression_]: ../expressions.md
183-
[_LazyBooleanOperatorExpression_]: operator-expr.md#lazy-boolean-operators
184-
[_Pattern_]: ../patterns.md
185-
[_Scrutinee_]: match-expr.md
186181
[`match` expressions]: match-expr.md
187182
[boolean type]: ../types/boolean.md
188183
[scrutinee]: ../glossary.md#scrutinee

src/expressions/loop-expr.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ A `while` loop expression allows repeating the evaluation of a block while a set
6060

6161
r[expr.loop.while.syntax]
6262
The syntax of a `while` expression is a sequence of one or more condition operands separated by `&&`,
63-
followed by a [_BlockExpression_].
63+
followed by a [BlockExpression].
6464

6565
r[expr.loop.while.condition]
66-
Condition operands must be either an [_Expression_] with a [boolean type] or a conditional `let` match.
66+
Condition operands must be either an [Expression] with a [boolean type] or a conditional `let` match.
6767
If all of the condition operands evaluate to `true` and all of the `let` patterns successfully match their [scrutinee]s,
6868
then the loop body block executes.
6969

@@ -392,8 +392,6 @@ r[expr.loop.break-value.loop]
392392
In the case a `loop` has an associated `break`, it is not considered diverging, and the `loop` must have a type compatible with each `break` expression.
393393
`break` without an expression is considered identical to `break` with expression `()`.
394394

395-
[_BlockExpression_]: block-expr.md
396-
[_Expression_]: ../expressions.md
397395
[`if` condition chains]: if-expr.md#chains-of-conditions
398396
[`if` expressions]: if-expr.md
399397
[`match` expression]: match-expr.md

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)