Skip to content

Commit b494dab

Browse files
committed
Clean up a few uses of the word "namespace".
Since "namespace" has a specific meaning in Rust, I feel like it would be good not to overload it too much with the sense of a scope container like a C++ namespace.
1 parent b0601ea commit b494dab

File tree

4 files changed

+12
-20
lines changed

4 files changed

+12
-20
lines changed

src/attributes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ active. All other attributes are inert.
174174
## Tool attributes
175175

176176
The compiler may allow attributes for external tools where each tool resides
177-
in its own namespace in the [tool prelude]. The first segment of the attribute
177+
in its own module in the [tool prelude]. The first segment of the attribute
178178
path is the name of the tool, with one or more additional segments whose
179179
interpretation is up to the tool.
180180

src/items/generics.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,8 @@ referred to with path syntax.
4343

4444
### Const generics
4545

46-
*Const generic parameters* allow items to be generic over constant values. The
47-
const identifier introduces a name for the constant parameter, and all
48-
instances of the item must be instantiated with a value of the given type.
49-
50-
<!-- TODO: update above to say "introduces a name in the [value namespace]"
51-
once namespaces are added. -->
46+
*Const generic parameters* allow items to be generic over constant values.
47+
The const identifier introduces a name in the [value namespace] for the constant parameter, and all instances of the item must be instantiated with a value of the given type.
5248

5349
The only allowed types of const parameters are `u8`, `u16`, `u32`, `u64`, `u128`, `usize`
5450
`i8`, `i16`, `i32`, `i64`, `i128`, `isize`, `char` and `bool`.
@@ -286,6 +282,7 @@ struct Foo<#[my_flexible_clone(unbounded)] H> {
286282
[arrays]: ../types/array.md
287283
[associated const]: associated-items.md#associated-constants
288284
[associated type]: associated-items.md#associated-types
285+
[attributes]: ../attributes.md
289286
[block]: ../expressions/block-expr.md
290287
[const contexts]: ../const_eval.md#const-context
291288
[const expression]: ../const_eval.md#constant-expressions
@@ -313,4 +310,4 @@ struct Foo<#[my_flexible_clone(unbounded)] H> {
313310
[type aliases]: type-aliases.md
314311
[type]: ../types.md
315312
[unions]: unions.md
316-
[attributes]: ../attributes.md
313+
[value namespace]: ../names/namespaces.md

src/names/namespaces.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ into separate namespaces based on the kind of entity the name refers to.
55
Namespaces allow the occurrence of a name in one namespace to not conflict
66
with the same name in another namespace.
77

8-
Within a namespace, names are organized in a hierarchy, where each level of
9-
the hierarchy has its own collection of named entities.
10-
118
There are several different namespaces that each contain different kinds of
129
entities. The usage of a name will look for the declaration of that name in
1310
different namespaces, based on the context, as described in the [name

src/paths.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
# Paths
22

3-
A *path* is a sequence of one or more path segments _logically_ separated by
4-
a namespace <span class="parenthetical">qualifier (`::`)</span>. If a path
5-
consists of only one segment, it refers to either an [item] or a [variable] in
6-
a local control scope. If a path has multiple segments, it always refers to an
7-
item.
3+
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].
85

96
Two examples of simple paths consisting of only identifier segments:
107

@@ -25,7 +22,7 @@ x::y::z;
2522
> _SimplePathSegment_ :\
2623
> &nbsp;&nbsp; [IDENTIFIER] | `super` | `self` | `crate` | `$crate`
2724
28-
Simple paths are used in [visibility] markers, [attributes], [macros], and [`use`] items.
25+
Simple paths are used in [visibility] markers, [attributes], [macros][mbe], and [`use`] items.
2926
Examples:
3027

3128
```rust
@@ -384,8 +381,7 @@ mod without { // ::without
384381
[_SimplePathSegment_]: #simple-paths
385382
[_Type_]: types.md#type-expressions
386383
[literal]: expressions/literal-expr.md
387-
[item]: items.md
388-
[variable]: variables.md
384+
[items]: items.md
389385
[implementations]: items/implementations.md
390386
[use declarations]: items/use-declarations.md
391387
[IDENTIFIER]: identifiers.md
@@ -394,8 +390,10 @@ mod without { // ::without
394390
[expressions]: expressions.md
395391
[extern prelude]: names/preludes.md#extern-prelude
396392
[macro transcribers]: macros-by-example.md
397-
[macros]: macros-by-example.md
393+
[macros]: macros.md
394+
[mbe]: macros-by-example.md
398395
[patterns]: patterns.md
399396
[trait implementations]: items/implementations.md#trait-implementations
400397
[traits]: items/traits.md
398+
[types]: types.md
401399
[visibility]: visibility-and-privacy.md

0 commit comments

Comments
 (0)