Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: specifies the max length for crate name #11051

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/doc/src/reference/manifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,17 @@ The package name is an identifier used to refer to the package. It is used
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.
The name must use only [alphanumeric] characters or `-` or `_`, and cannot be
empty.
weihanglo marked this conversation as resolved.
Show resolved Hide resolved

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
EstebanBorai marked this conversation as resolved.
Show resolved Hide resolved

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

Expand Down