Skip to content

Commit

Permalink
Auto merge of #11051 - EstebanBorai:fix/specify-crate-name-maxlength,…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
bors committed Sep 6, 2022
2 parents 646e9a0 + 98ccc09 commit a8d61d0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/doc/src/reference/manifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,15 @@ when listed as a dependency in another package, and as the default name of
inferred lib and bin targets.

The name must use only [alphanumeric] characters or `-` or `_`, and cannot be empty.

Note that [`cargo new`] and [`cargo init`] impose some additional restrictions on
the package name, such as enforcing that it is a valid Rust identifier and not
a keyword. [crates.io] imposes even more restrictions, such as
enforcing only ASCII characters, not a reserved name, not a special Windows
name such as "nul", is not too long, etc.
a keyword. [crates.io] imposes even more restrictions, such as:

- Only ASCII characters are allowed.
- Do not use reserved names.
- Do not use special Windows name such as "nul".
- Use a maximum of 64 characters of length.

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

Expand Down

0 comments on commit a8d61d0

Please sign in to comment.