You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: text/0000-packages-as-optional-namespaces.md
+8-6Lines changed: 8 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -60,18 +60,20 @@ Only the owners of `foo` may _create_ the `foo::bar` crate (and all owners of `f
60
60
61
61
# Reference-level explanation
62
62
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_
64
64
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:
66
68
67
69
-`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`
69
71
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`.
71
73
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.
73
75
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`.
75
77
76
78
`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`.
0 commit comments