Skip to content

Commit 8da1fb7

Browse files
yaahcehuss
andcommitted
Apply suggestions from code review
Co-authored-by: Eric Huss <eric@huss.org>
1 parent ea66749 commit 8da1fb7

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

src/names/name-resolution.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ r[names.resolution.expansion.expansion-order-stability]
4343
The resolution of names must be *stable*. After expansion, names in the fully expanded AST must resolve to the same definition, regardless of the order in which macros are expanded.
4444

4545
r[names.resolution.expansion.speculation]
46-
All name resolution candidates selected during macro expansion are considering speculative. Once the crate has been fully expanded all speculative import resolutions are validated to ensure that no new ambiguities were introduced by macro expansion.
46+
All name resolution candidates selected during macro expansion are considered speculative. Once the crate has been fully expanded, all speculative import resolutions are validated to ensure that macro expansion did not introduce any new ambiguities.
4747

4848
> [!NOTE]
4949
>
@@ -130,7 +130,7 @@ r[names.resolution.expansion.imports.ambiguity]
130130
r[names.resolution.expansion.imports.ambiguity.intro]
131131
Some situations are an error when there is an ambiguity as to which macro definition, `use` declaration, or module an import or macro invocation's name refers to. This happens when there are two name candidates that do not resolve to the same entity where neither candidate is [permitted] to shadow the other.
132132

133-
r[names.resolution.expansion.imports.ambiguity.globvsglob]
133+
r[names.resolution.expansion.imports.ambiguity.glob-vs-glob]
134134
Names may not be resolved through ambiguous glob imports. Glob imports are allowed to import conflicting names in the same namespace as long as the name is not used. Names with conflicting candidates from ambiguous glob imports may still be shadowed by non glob imports and used without producing an error. The errors occur at time of use, not time of import.
135135

136136
For example:
@@ -223,7 +223,7 @@ pub fn qux() {
223223
```
224224

225225
> [!NOTE]
226-
> These ambiguity errors are specific to imports, even though they are only observed when those imports are used, having multiple candidates available for a given name during later stages of resolution is not considered an error, so long as none of the imports themselves are ambiguous, there will always be a single unambiguous closest resolution during later stages.
226+
> These ambiguity errors are specific to imports, even though they are only observed when those imports are used. Having multiple candidates available for a given name during later stages of resolution is not considered an error, so long as none of the imports themselves are ambiguous, there will always be a single unambiguous closest resolution.
227227
>
228228
> ```rust
229229
> mod bar {
@@ -333,10 +333,7 @@ The available scopes are visited in the following order.
333333

334334
> [!NOTE]
335335
>
336-
> The compiler will attempt to resolve derive helpers that are used before
337-
> their associated macro introduces them into scope after resolving derive
338-
> helper candidates that are correctly in scope. This behavior is slated for
339-
> removal.
336+
> The compiler will attempt to resolve derive helpers that are used before their associated macro introduces them into scope after resolving derive helper candidates that are correctly in scope. This behavior is slated for removal.
340337
>
341338
> For more info see [derive helper scope].
342339
@@ -345,7 +342,7 @@ The available scopes are visited in the following order.
345342
> Starting in edition 2018 the `#[macro_use]` prelude is not visited when `#[no_implicit_prelude]` is present.
346343
347344
r[names.resolution.expansion.macros.derivehelpers]
348-
not visited when resolving derive macros in the parent scope (starting scope)
345+
Derive helper scopes are not visited when resolving derive macros in the parent scope (starting scope).
349346

350347
r[names.resolution.expansion.macros.reserved-names]
351348
The names `cfg` and `cfg_attr` are reserved in the macro attribute [sub-namespace].

src/procedural-macros.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,10 @@ A helper attribute for a derive macro is declared by adding its identifier to th
241241
> ```
242242
243243
r[macro.proc.derive.attributes.scope]
244-
Helper attributes are in scope after the macro that introduces them.
244+
Helper attributes are in scope as name candidates for resolving the names of attributes that are attached to the same item lexically after the macro that introduces them.
245245
246246
> [!NOTE]
247-
> rustc currently allows derive helpers to be used before the macro that
248-
> introduces them. Such derive helpers used out of order may not shadow other
249-
> attribute macros. This behavior is deprecated and slated for removal.
247+
> rustc currently allows derive helpers to be used before the macro that introduces them. Such derive helpers used out of order may not shadow other attribute macros. This behavior is deprecated and slated for removal.
250248
>
251249
> <!-- ignore: requires external crates -->
252250
> ```rust,ignore

0 commit comments

Comments
 (0)