Skip to content

Commit 6d20724

Browse files
authored
Merge pull request #2222 from rust-lang/TC/fix-misuse-of-usage
Fix misuse of *usage* throughout the Reference
2 parents d2715c0 + f98bfa3 commit 6d20724

14 files changed

Lines changed: 20 additions & 20 deletions

src/attributes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ The following is an index of all built-in attributes.
223223
- [`automatically_derived`] --- Marker for implementations created by `derive`.
224224

225225
- Macros
226-
- [`macro_export`] --- Exports a `macro_rules` macro for cross-crate usage.
226+
- [`macro_export`] --- Exports a `macro_rules` macro for cross-crate use.
227227
- [`macro_use`] --- Expands macro visibility, or imports macros from other crates.
228228
- [`proc_macro`] --- Defines a function-like macro.
229229
- [`proc_macro_derive`] --- Defines a derive macro.

src/attributes/codegen.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ r[attributes.codegen.target_feature.x86]
274274
#### `x86` or `x86_64`
275275

276276
Executing code with unsupported features is undefined behavior on this platform.
277-
Hence on this platform usage of `#[target_feature]` functions follows the
277+
Hence on this platform use of `#[target_feature]` functions follows the
278278
[above restrictions][attributes.codegen.target_feature.safety-restrictions].
279279

280280
Feature | Implicitly Enables | Description
@@ -399,7 +399,7 @@ Feature | Implicitly Enables | Description
399399
r[attributes.codegen.target_feature.aarch64]
400400
#### `aarch64`
401401

402-
On this platform the usage of `#[target_feature]` functions follows the
402+
On this platform the use of `#[target_feature]` functions follows the
403403
[above restrictions][attributes.codegen.target_feature.safety-restrictions].
404404

405405
Further documentation on these features can be found in the [ARM Architecture
@@ -462,7 +462,7 @@ Feature | Implicitly Enables | Feature Name
462462
r[attributes.codegen.target_feature.loongarch]
463463
#### `loongarch`
464464

465-
On this platform the usage of `#[target_feature]` functions follows the
465+
On this platform the use of `#[target_feature]` functions follows the
466466
[above restrictions][attributes.codegen.target_feature.safety-restrictions].
467467

468468
Feature | Implicitly Enables | Description
@@ -488,7 +488,7 @@ Feature | Implicitly Enables | Description
488488
r[attributes.codegen.target_feature.riscv]
489489
#### `riscv32` or `riscv64`
490490

491-
On this platform the usage of `#[target_feature]` functions follows the
491+
On this platform the use of `#[target_feature]` functions follows the
492492
[above restrictions][attributes.codegen.target_feature.safety-restrictions].
493493

494494
Further documentation on these features can be found in their respective

src/attributes/diagnostics.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ lints that would otherwise warn within the entity.
261261
fn example_err() {
262262
// This is an error because the `unsafe_code` warning has
263263
// been lifted to "deny".
264-
unsafe { an_unsafe_fn() } // ERROR: usage of `unsafe` block
264+
unsafe { an_unsafe_fn() } // ERROR: use of `unsafe` block
265265
}
266266
```
267267

@@ -304,7 +304,7 @@ r[attributes.diagnostics.deprecated]
304304

305305
r[attributes.diagnostics.deprecated.intro]
306306
The *`deprecated` attribute* marks an item as deprecated. `rustc` will issue
307-
warnings on usage of `#[deprecated]` items. `rustdoc` will show item
307+
warnings on use of `#[deprecated]` items. `rustdoc` will show item
308308
deprecation, including the `since` version and `note`, if available.
309309

310310
r[attributes.diagnostics.deprecated.syntax]

src/inline-assembly.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ unsafe { core::arch::asm!("/* {x} */"); } // ERROR: no argument named x
183183
```
184184

185185
r[asm.ts-args.one-or-more]
186-
An `asm!` invocation may have one or more template string arguments; an `asm!` with multiple template string arguments is treated as if all the strings were concatenated with a `\n` between them. The expected usage is for each template string argument to correspond to a line of assembly code.
186+
An `asm!` invocation may have one or more template string arguments; an `asm!` with multiple template string arguments is treated as if all the strings were concatenated with a `\n` between them. The expected use is for each template string argument to correspond to a line of assembly code.
187187

188188
```rust
189189
# #[cfg(target_arch = "x86_64")] {

src/items/constant-items.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ r[items.const.intro]
1111
A *constant item* is an optionally named _[constant value]_ which is not associated with a specific memory location in the program.
1212

1313
r[items.const.behavior]
14-
Constants are essentially inlined wherever they are used, meaning that they are copied directly into the relevant context when used. This includes usage of constants from external crates, and non-[`Copy`] types. References to the same constant are not necessarily guaranteed to refer to the same memory address.
14+
Constants are essentially inlined wherever they are used, meaning that they are copied directly into the relevant context when used. This includes use of constants from external crates, and non-[`Copy`] types. References to the same constant are not necessarily guaranteed to refer to the same memory address.
1515

1616
r[items.const.namespace]
1717
The constant declaration defines the constant value in the [value namespace] of the module or block where it is located.

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/items/use-declarations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ mod example {
201201
```
202202

203203
> [!NOTE]
204-
> `self` may also be used as the first segment of a path. The usage of `self` as the first segment and inside a `use` brace is logically the same; it means the current module of the parent segment, or the current module if there is no parent segment. See [`self`] in the paths chapter for more information on the meaning of a leading `self`.
204+
> `self` may also be used as the first segment of a path. The use of `self` as the first segment and inside a `use` brace is logically the same; it means the current module of the parent segment, or the current module if there is no parent segment. See [`self`] in the paths chapter for more information on the meaning of a leading `self`.
205205
206206
r[items.use.self.namespace]
207207
`self` only creates a binding from the [type namespace] of the parent entity. For example, in the following, only the `foo` mod is imported:

src/linkage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ found in the [FFI section of the book][ffi].
1414

1515
r[link.type]
1616
In one session of compilation, the compiler can generate multiple artifacts
17-
through the usage of either command line flags or the `crate_type` attribute.
17+
through the use of either command line flags or the `crate_type` attribute.
1818
If one or more command line flags are specified, all `crate_type` attributes will
1919
be ignored in favor of only building the artifacts specified by command line.
2020

0 commit comments

Comments
 (0)