Skip to content

Commit 482fae8

Browse files
authored
Update 0000-packages-as-optional-namespaces.md
1 parent 56fae2e commit 482fae8

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

text/0000-packages-as-optional-namespaces.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,20 @@ Only the owners of `foo` may _create_ the `foo::bar` crate (and all owners of `f
6060

6161
# Reference-level explanation
6262

63-
`::` is now considered valid inside crate names on Crates.io and Cargo. For now, we will restrict crate names to having a single `::` in them, not at the beginning or end of the name, but this can be changed in the future.
63+
_This section will maintain a distinction between "package" (a crates.io package) and "crate" (the actual rust library). The rest of the RFC does not attempt to make this distinction_
6464

65-
When publishing a crate `foo::bar`, if the crate does not exist, the following must be true:
65+
`::` is now considered valid inside package names on Crates.io. For now, we will restrict package names to having a single `::` in them, not at the beginning or end of the name, but this can be changed in the future.
66+
67+
When publishing a package `foo::bar`, if the package does not exist, the following must be true:
6668

6769
- `foo` must exist
68-
- The user publishing the crate must be an owner of `foo`
70+
- The user publishing the package must be an owner of `foo`
6971

70-
For the crate `foo::bar`, all owners of `foo` are always considered owners of `foo::bar`, however additional owners may be added. People removed from ownership of `foo` will also lose access to `foo::bar` unless they were explicitly added as owners to `foo::bar`.
72+
For the package `foo::bar`, all owners of `foo` are always considered owners of `foo::bar`, however additional owners may be added. People removed from ownership of `foo` will also lose access to `foo::bar` unless they were explicitly added as owners to `foo::bar`.
7173

72-
Crates.io displays `foo::bar` crates with the name `foo::bar`, though it may stylistically make the `foo` part link to the `foo` crate.
74+
Crates.io displays `foo::bar` packages with the name `foo::bar`, though it may stylistically make the `foo` part link to the `foo` package.
7375

74-
The [registry index trie](https://doc.rust-lang.org/nightly/cargo/reference/registries.html#index-format) may represent subpackages by placing `foo::bar` as just `foo/bar` or using some special character..
76+
The [registry index trie](https://doc.rust-lang.org/nightly/cargo/reference/registries.html#index-format) may represent subpackages by placing `foo::bar` as just `foo::bar`.
7577

7678
`rustc` will need some changes. When `--extern foo::bar=crate.rlib` is passed in, `rustc` will include this crate during resolution as if it were a module `bar` living under crate `foo`. If crate `foo` is _also_ in scope, this will not automatically trigger any errors unless `foo::bar` is referenced, `foo` has a module `bar`, and that module is not just a reexport of crate `foo::bar`.
7779

0 commit comments

Comments
 (0)