Skip to content

Commit 4991393

Browse files
committed
Make some editorial improvements
We've merged PR rust-lang#1040, so we can remove the TODO and update the link to point to the specific section. We replace some commas with semicolons where that's the right thing to do grammatically. Where we have "an X is... they are...", we replace that with "an X is... Xs are..." for reasons of avoiding a mismatch between the plurality of the pronoun and its referent. We replace "implementing type" and "defining type" with "type being implemented" and "type being defined", since there is in general a difference (e.g. "the driving force" vs "the force being driven"), and these seem more like the latter than the former. There's a place where we had said, "glob imports are allowed to import conflicting names into the same *namespaces*" (emphasis added). It makes sense what this is trying to say by using the plural there. But it just reads better to use the singular, and if it's true for the singular, it's clearly also true to the plural, so we make that change.
1 parent 325b14e commit 4991393

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/items/use-declarations.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ m!(use std as _;);
320320
The following are restrictions for valid `use` declarations.
321321

322322
* `use crate;` must use `as` to define the name to bind the crate root to.
323-
* `use {self};` is an error, there must be a leading segment when using `self`.
323+
* `use {self};` is an error; there must be a leading segment when using `self`.
324324
* As with any item definition, `use` imports cannot create duplicate bindings of the same name in the same namespace in a module or block.
325325
* `use` paths with `$crate` are not allowed in a [`macro_rules`] expansion.
326326
* `use` paths cannot refer to enum variants through a [type alias]. Example:
@@ -338,9 +338,9 @@ The following are restrictions for valid `use` declarations.
338338

339339
> **Note**: This section is incomplete.
340340
341-
Some situations are an error when there is an ambiguity as to which name a `use` declaration refers to, when there are two name candidates that do not resolve to the same entity.
341+
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.
342342

343-
Glob imports are allowed to import conflicting names in the same namespaces as long as the name is not used or shadowed.
343+
Glob imports are allowed to import conflicting names in the same namespace as long as the name is not used or shadowed.
344344
Example:
345345

346346
```rust

src/paths.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Paths
22

33
A *path* is a sequence of one or more path segments separated by `::` tokens.
4-
They are used to refer to [items], values, [types], [macros], and [attributes].
4+
Paths are used to refer to [items], values, [types], [macros], and [attributes].
55

66
Two examples of simple paths consisting of only identifier segments:
77

@@ -224,13 +224,12 @@ impl S {
224224
`Self`, with a capital "S", is used to refer to the current type being implemented or defined. It may be used in the following situations:
225225

226226
* In a [trait] definition, it refers to the type implementing the trait.
227-
* In an [implementation], it refers to the implementing type.
227+
* In an [implementation], it refers to the type being implemented.
228228
When implementing a tuple or unit [struct], it also refers to the constructor in the [value namespace].
229-
* In the definition of a [struct], [enumeration], or [union], it refers to the defining type.
229+
* In the definition of a [struct], [enumeration], or [union], it refers to the type being defined.
230230
The definition is not allowed to be infinitely recursive (there must be an indirection).
231231

232-
The scope of `Self` behaves similarly to a generic parameter, see the [scopes chapter] for more details.
233-
<!-- TODO: update link to #self-scope once https://github.com/rust-lang/reference/pull/1040 is merged. -->
232+
The scope of `Self` behaves similarly to a generic parameter; see the [`Self` scope] section for more details.
234233

235234
`Self` can only be used as the first segment, without a preceding `::`.
236235
The `Self` path cannot include generic arguments (as in `Self::<i32>`).
@@ -425,6 +424,7 @@ mod without { // crate::without
425424
[implementations]: items/implementations.md
426425
[use declarations]: items/use-declarations.md
427426
[IDENTIFIER]: identifiers.md
427+
[`Self` scope]: names/scopes.md#self-scope
428428
[`use`]: items/use-declarations.md
429429
[attributes]: attributes.md
430430
[enumeration]: items/enumerations.md
@@ -435,7 +435,6 @@ mod without { // crate::without
435435
[macros]: macros.md
436436
[mbe]: macros-by-example.md
437437
[patterns]: patterns.md
438-
[scopes chapter]: names/scopes.md
439438
[struct]: items/structs.md
440439
[trait implementations]: items/implementations.md#trait-implementations
441440
[trait]: items/traits.md

0 commit comments

Comments
 (0)