Skip to content

Commit 2909c01

Browse files
authored
docs(ref): Deprecate 'package.authors' (#15068)
### What does this PR try to resolve? This was left as a future-possibility in [RFC #3052](https://rust-lang.github.io/rfcs/3052-optional-authors-field.html). Without a clear role for this field within Cargo/crates.io, there seems little reason to actively support it (e.g. #14949, #15027), including working through feature requests. I see the potential for having some fields with more specific roles (where to go for support, where to go for disclosing vulnerabilities, etc) but even these run into the mutable data problem of `authors`. Users can always manage metadata for their own purposes through `package.metadata`. The RFC called out clap as an example of something that uses this. Clap no longer does by default but users can opt-in through a `help_template`. For now, this notes the status in the documentation. When we have[user control over Cargo lint (#12235) (and figure out namespacing with lints that overlap with Rust), we can give a warning on this. Based on feedback from users, we can evaluate removing this field in a future edition. This is as discussed in a recent Cargo team meeting ### How should we test and review this PR? ### Additional information We may want to consider doing similar for `badges`
2 parents 149aa21 + 32d6e9d commit 2909c01

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

src/doc/src/reference/manifest.md

+5-11
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ The first section in a `Cargo.toml` is `[package]`.
6363
[package]
6464
name = "hello_world" # the name of the package
6565
version = "0.1.0" # the current version, obeying semver
66-
authors = ["Alice <[email protected]>", "Bob <[email protected]>"]
6766
```
6867

6968
The only field required by Cargo is [`name`](#the-name-field). If publishing to
@@ -121,10 +120,10 @@ This field is optional and defaults to `0.0.0`. The field is required for publi
121120

122121
### The `authors` field
123122

123+
> **Warning**: This field is deprecated
124+
124125
The optional `authors` field lists in an array the people or organizations that are considered
125-
the "authors" of the package. The exact meaning is open to interpretation --- it
126-
may list the original or primary authors, current maintainers, or owners of the
127-
package. An optional email address may be included within angled brackets at
126+
the "authors" of the package. An optional email address may be included within angled brackets at
128127
the end of each author entry.
129128

130129
```toml
@@ -133,13 +132,8 @@ the end of each author entry.
133132
authors = ["Graydon Hoare", "Fnu Lnu <[email protected]>"]
134133
```
135134

136-
This field is only surfaced in package metadata and in the `CARGO_PKG_AUTHORS`
137-
environment variable within `build.rs`. It is not displayed in the [crates.io]
138-
user interface.
139-
140-
> **Warning**: Package manifests cannot be changed once published, so this
141-
> field cannot be changed or removed in already-published versions of a
142-
> package.
135+
This field is surfaced in package metadata and in the `CARGO_PKG_AUTHORS`
136+
environment variable within `build.rs` for backwards compatibility.
143137

144138
### The `edition` field
145139

src/doc/src/reference/workspaces.md

-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ where the workspace's `Cargo.toml` is located.
5454
[package]
5555
name = "hello_world" # the name of the package
5656
version = "0.1.0" # the current version, obeying semver
57-
authors = ["Alice <[email protected]>", "Bob <[email protected]>"]
5857
```
5958

6059
### Virtual workspace
@@ -77,7 +76,6 @@ resolver = "2"
7776
name = "hello_world" # the name of the package
7877
version = "0.1.0" # the current version, obeying semver
7978
edition = "2024" # the edition, will have no effect on a resolver used in the workspace
80-
authors = ["Alice <[email protected]>", "Bob <[email protected]>"]
8179
```
8280

8381
By having a workspace without a root package,

0 commit comments

Comments
 (0)