Skip to content

Commit 9ecc7f8

Browse files
committed
Auto merge of #11051 - EstebanBorai:fix/specify-crate-name-maxlength, r=weihanglo
fix: specifies the max length for crate name Provides the maximum length on the crate name as is defined in the [crate's validation source code from crates.io][1]. [1]: https://github.com/rust-lang/crates.io/blob/3fc08ba57e782cff422a2f92503f09287d1a5140/src/models/krate.rs#L74
2 parents 646e9a0 + 98ccc09 commit 9ecc7f8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/doc/src/reference/manifest.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,15 @@ when listed as a dependency in another package, and as the default name of
7474
inferred lib and bin targets.
7575

7676
The name must use only [alphanumeric] characters or `-` or `_`, and cannot be empty.
77+
7778
Note that [`cargo new`] and [`cargo init`] impose some additional restrictions on
7879
the package name, such as enforcing that it is a valid Rust identifier and not
79-
a keyword. [crates.io] imposes even more restrictions, such as
80-
enforcing only ASCII characters, not a reserved name, not a special Windows
81-
name such as "nul", is not too long, etc.
80+
a keyword. [crates.io] imposes even more restrictions, such as:
81+
82+
- Only ASCII characters are allowed.
83+
- Do not use reserved names.
84+
- Do not use special Windows name such as "nul".
85+
- Use a maximum of 64 characters of length.
8286

8387
[alphanumeric]: ../../std/primitive.char.html#method.is_alphanumeric
8488

0 commit comments

Comments
 (0)