Skip to content

Commit f98bfa3

Browse files
committed
Fix misuse of *usage* in rule identifiers
In the prior commit, we fixed prose occurrences of *usage*. The same reasoning applies to the rule identifiers. These rules describe where the language permits a construct to appear. On the surface, that may seem to be a kind of pattern of use, but it's not (in the sense implied by *usage*), and ultimately *use* is still the right word. The word *usage* describes conventions and customs -- i.e., *customary* patterns of use. It describes how a community uses something and how that varies, e.g., across regions. That's not what we're doing here. We're not describing better or worse Rust idioms. There's no "nonstandard usage" of Rust grammatical constructs -- that's not what we're defining, at least. Let's fix each rule identifier to use `use` instead. (None of these identifiers were referenced elsewhere in the Reference.)
1 parent 74812db commit f98bfa3

6 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/items/generics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ The const identifier introduces a name in the [value namespace] for the constant
5656
r[items.generics.const.allowed-types]
5757
The only allowed types of const parameters are `u8`, `u16`, `u32`, `u64`, `u128`, `usize`, `i8`, `i16`, `i32`, `i64`, `i128`, `isize`, `char` and `bool`.
5858

59-
r[items.generics.const.usage]
59+
r[items.generics.const.use]
6060
Const parameters can be used anywhere a [const item] can be used, with the exception that when used in a [type] or [array repeat expression], it must be standalone (as described below). That is, they are allowed in the following places:
6161

6262
1. As an applied const to any type which forms a part of the signature of the item in question.

src/items/implementations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ impl Seq<bool> for u32 {
188188
}
189189
```
190190

191-
r[items.impl.generics.usage]
191+
r[items.impl.generics.use]
192192
Generic parameters *constrain* an implementation if the parameter appears at least once in one of:
193193

194194
* The implemented trait, if it has one

src/items/unions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ fn test() {
180180
}
181181
```
182182

183-
r[items.union.ref.usage]
183+
r[items.union.ref.use]
184184
As you could see, in many aspects (except for layouts, safety, and ownership) unions behave exactly like structs, largely as a consequence of inheriting their syntactic shape from structs. This is also true for many unmentioned aspects of Rust language (such as privacy, name resolution, type inference, generics, trait implementations, inherent implementations, coherence, pattern checking, etc etc etc).
185185

186186
[`transmute`]: std::mem::transmute

src/patterns.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ if let
6161
}
6262
```
6363

64-
r[patterns.usage]
64+
r[patterns.use]
6565
Patterns are used in:
6666

6767
r[patterns.let]

src/types/boolean.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ An object with the boolean type has a [size and alignment] of 1 each.
2020
r[type.bool.repr]
2121
The value false has the bit pattern `0x00` and the value true has the bit pattern `0x01`. It is [undefined behavior] for an object with the boolean type to have any other bit pattern.
2222

23-
r[type.bool.usage]
23+
r[type.bool.use]
2424
The boolean type is the type of many operands in various [expressions]:
2525

26-
r[type.bool.usage-condition]
26+
r[type.bool.use-in-condition]
2727
* The condition operand in [if expressions] and [while expressions]
2828

29-
r[type.bool.usage-lazy-operator]
29+
r[type.bool.use-in-lazy-operator]
3030
* The operands in [lazy boolean operator expressions][lazy]
3131

3232
> [!NOTE]

src/visibility-and-privacy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ These two cases are surprisingly powerful for creating module hierarchies exposi
5656

5757
In the second case, it mentions that a private item "can be accessed" by the current module and its descendants, but the exact meaning of accessing an item depends on what the item is.
5858

59-
r[vis.usage]
59+
r[vis.use]
6060
Accessing a module, for example, would mean looking inside of it (to import more items). On the other hand, accessing a function would mean that it is invoked. Additionally, path expressions and import statements are considered to access an item in the sense that the import/expression is only valid if the destination is in the current visibility scope.
6161

6262
Here's an example of a program which exemplifies the three cases outlined above:

0 commit comments

Comments
 (0)