Skip to content

Commit ff7f2bc

Browse files
committed
Auto merge of #6447 - ehuss:doc-name-authors, r=alexcrichton
Document `name` and `authors` in [package] I don't think we need to take a principled stand on the exact meaning of "authors", so I left it somewhat vague. Also, it was made optional in #3682 so the existing docs were a little wrong. Closes #5934
2 parents 5c3b8f2 + e2074df commit ff7f2bc

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

src/doc/src/reference/manifest.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,20 @@ version = "0.1.0" # the current version, obeying semver
1414
authors = ["Alice <[email protected]>", "Bob <[email protected]>"]
1515
```
1616

17-
All three of these fields are mandatory.
17+
#### The `name` field
18+
19+
The package name is an identifier used to refer to the package. It is used
20+
when listed as a dependency in another package, and as the default name of
21+
inferred lib and bin targets.
22+
23+
The name must not be empty, use only [alphanumeric] characters or `-` or `_`.
24+
Note that `cargo new` and `cargo init` impose some additional restrictions on
25+
the package name, such as enforcing that it is a valid Rust identifier and not
26+
a keyword. [crates.io][cratesio] imposes even more restrictions, such as
27+
enforcing only ASCII characters, not a reserved name, not a special Windows
28+
name such as "nul", is not too long, etc.
29+
30+
[alphanumeric]: https://doc.rust-lang.org/std/primitive.char.html#method.is_alphanumeric
1831

1932
#### The `version` field
2033

@@ -31,6 +44,15 @@ Versioning](http://semver.org/), so make sure you follow some basic rules:
3144
traits, fields, types, functions, methods or anything else.
3245
* Use version numbers with three numeric parts such as 1.0.0 rather than 1.0.
3346

47+
#### The `authors` field (optional)
48+
49+
The `authors` field lists people or organizations that are considered the
50+
"authors" of the package. The exact meaning is open to interpretation — it may
51+
list the original or primary authors, current maintainers, or owners of the
52+
package. These names will be listed on the crate's page on
53+
[crates.io][cratesio]. An optional email address may be included within angled
54+
brackets at the end of each author.
55+
3456
#### The `edition` field (optional)
3557

3658
You can opt in to a specific Rust Edition for your package with the

0 commit comments

Comments
 (0)