Skip to content

Commit b563d02

Browse files
committed
Consistently use "items"
1 parent 7e8a9fd commit b563d02

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

src/items/functions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ aborts the process by executing an illegal instruction.
266266

267267
r[items.fn.const]
268268

269-
r[item.fn.const.intro]
269+
r[items.fn.const.intro]
270270
Functions qualified with the `const` keyword are [const functions], as are
271271
[tuple struct] and [tuple variant] constructors. _Const functions_ can be
272272
called from within [const contexts].

src/items/traits.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ other traits and so forth [as usual][generics].
3636
r[items.trait.impls]
3737
Traits are implemented for specific types through separate [implementations].
3838

39-
r[item.trait.associated-item-decls]
39+
r[items.trait.associated-item-decls]
4040
Trait functions may omit the function body by replacing it with a semicolon.
4141
This indicates that the implementation must define the function. If the trait
4242
function defines a body, this definition acts as a default for any

src/items/use-declarations.md

+26-26
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ r[items.use.path.edition2015]
167167
168168
## `as` renames
169169
170-
r[item.use.as]
170+
r[items.use.as]
171171
172172
The `as` keyword can be used to change the name of an imported entity.
173173
For example:
@@ -183,9 +183,9 @@ mod inner {
183183
184184
## Brace syntax
185185

186-
r[item.use.multiple-syntax]
186+
r[items.use.multiple-syntax]
187187

188-
r[item.use.multiple-syntax.intro]
188+
r[items.use.multiple-syntax.intro]
189189
Braces can be used in the last segment of the path to import multiple entities from the previous segment, or, if there are no previous segments, from the current scope.
190190
Braces can be nested, creating a tree of paths, where each grouping of segments is logically combined with its parent to create a full path.
191191

@@ -197,18 +197,18 @@ Braces can be nested, creating a tree of paths, where each grouping of segments
197197
use std::collections::{BTreeSet, hash_map::{self, HashMap}};
198198
```
199199

200-
r[item.use.multiple-syntax.sempty]
200+
r[items.use.multiple-syntax.sempty]
201201
An empty brace does not import anything, though the leading path is validated that it is accessible.
202202
<!-- This is slightly wrong, see: https://github.com/rust-lang/rust/issues/61826 -->
203203

204-
r[item.use.multiple-syntax.edition2015]
204+
r[items.use.multiple-syntax.edition2015]
205205
> **Edition differences**: In the 2015 edition, paths are relative to the crate root, so an import such as `use {foo, bar};` will import the names `foo` and `bar` from the crate root, whereas starting in 2018, those names are relative to the current scope.
206206
207207
## `self` imports
208208

209-
r[item.use.self]
209+
r[items.use.self]
210210

211-
r[item.use.self.intro]
211+
r[items.use.self.intro]
212212
The keyword `self` may be used within [brace syntax](#brace-syntax) to create a binding of the parent entity under its own name.
213213

214214
```rust
@@ -227,7 +227,7 @@ mod example {
227227
# fn main() {}
228228
```
229229

230-
r[item.use.self.namespace]
230+
r[items.use.self.namespace]
231231
`self` only creates a binding from the [type namespace] of the parent entity.
232232
For example, in the following, only the `foo` mod is imported:
233233

@@ -252,9 +252,9 @@ fn main() {
252252
253253
## Glob imports
254254

255-
r[item.use.glob]
255+
r[items.use.glob]
256256

257-
r[item.use.glob.intro]
257+
r[items.use.glob.intro]
258258
The `*` character may be used as the last segment of a `use` path to import all importable entities from the entity of the preceding segment.
259259
For example:
260260

@@ -277,7 +277,7 @@ mod foo {
277277
}
278278
```
279279

280-
r[item.use.glob.shadowing]
280+
r[items.use.glob.shadowing]
281281
Items and named imports are allowed to shadow names from glob imports in the same [namespace].
282282
That is, if there is a name already defined by another item in the same namespace, the glob import will be shadowed.
283283
For example:
@@ -309,26 +309,26 @@ mod clashing {
309309
}
310310
```
311311

312-
r[item.use.glob.restriction]
312+
r[items.use.glob.restriction]
313313
`*` cannot be used as the first or intermediate segments.
314314
`*` cannot be used to import a module's contents into itself (such as `use self::*;`).
315315

316-
r[item.use.glob.edition2015]
316+
r[items.use.glob.edition2015]
317317
> **Edition differences**: In the 2015 edition, paths are relative to the crate root, so an import such as `use *;` is valid, and it means to import everything from the crate root.
318318
> This cannot be used in the crate root itself.
319319
320320
## Underscore Imports
321321

322-
r[item.use.as-underscore]
322+
r[items.use.as-underscore]
323323

324-
r[item.use.as-underscore.intro]
324+
r[items.use.as-underscore.intro]
325325
Items can be imported without binding to a name by using an underscore with
326326
the form `use path as _`. This is particularly useful to import a trait so
327327
that its methods may be used without importing the trait's symbol, for example
328328
if the trait's symbol may conflict with another symbol. Another example is to
329329
link an external crate without importing its name.
330330

331-
r[item.use.as-underscore.glob]
331+
r[items.use.as-underscore.glob]
332332
Asterisk glob imports will import items imported with `_` in their unnameable
333333
form.
334334

@@ -350,7 +350,7 @@ fn main() {
350350
}
351351
```
352352

353-
r[item.use.as-underscore.macro]
353+
r[items.use.as-underscore.macro]
354354
The unique, unnameable symbols are created after macro expansion so that
355355
macros may safely emit multiple references to `_` imports. For example, the
356356
following should not produce an error:
@@ -368,23 +368,23 @@ m!(use std as _;);
368368

369369
## Restrictions
370370

371-
r[item.use.restriction]
371+
r[items.use.restriction]
372372

373373
The following are restrictions for valid `use` declarations:
374374

375-
r[item.use.restriction.crate]
375+
r[items.use.restriction.crate]
376376
* `use crate;` must use `as` to define the name to which to bind the crate root.
377377

378-
r[item.use.restriction.self]
378+
r[items.use.restriction.self]
379379
* `use {self};` is an error; there must be a leading segment when using `self`.
380380

381-
r[item.use.restriction.duplicate-name]
381+
r[items.use.restriction.duplicate-name]
382382
* As with any item definition, `use` imports cannot create duplicate bindings of the same name in the same namespace in a module or block.
383383

384-
r[item.use.restriction.macro-crate]
384+
r[items.use.restriction.macro-crate]
385385
* `use` paths with `$crate` are not allowed in a [`macro_rules`] expansion.
386386

387-
r[item.use.restriction.variant]
387+
r[items.use.restriction.variant]
388388
* `use` paths cannot refer to enum variants through a [type alias]. For example:
389389
```rust,compile_fail
390390
enum MyEnum {
@@ -398,14 +398,14 @@ r[item.use.restriction.variant]
398398

399399
## Ambiguities
400400

401-
r[item.use.ambiguity]
401+
r[items.use.ambiguity]
402402

403403
> **Note**: This section is incomplete.
404404
405-
r[item.use.ambiguity.intro]
405+
r[items.use.ambiguity.intro]
406406
Some situations are an error when there is an ambiguity as to which name a `use` declaration refers. This happens when there are two name candidates that do not resolve to the same entity.
407407

408-
r[item.use.ambiguity.glob]
408+
r[items.use.ambiguity.glob]
409409
Glob imports are allowed to import conflicting names in the same namespace as long as the name is not used.
410410
For example:
411411

0 commit comments

Comments
 (0)