Skip to content

Commit 0c1a00f

Browse files
committed
Update documentation of the 'since' deprecated key
1 parent f3b862b commit 0c1a00f

File tree

1 file changed

+23
-9
lines changed

1 file changed

+23
-9
lines changed

text/0000-feature-metadata.md

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,28 @@ attribute in Rust source. The value can be a boolean, string, or an object with
133133
- If not specified, the default is `false`
134134

135135
If a downstream crate attempts to use a feature marked `deprecated`, Cargo
136-
should produce a warning. This warning should not be emitted for crates that
137-
reexport the feature under a feature also marked deprecated. For example: crate
138-
`foo` exports feature `phooey`, and crate `bar` exports feature
139-
`barred = ["foo/phooey"]`. If `foo` markes `bar` as deprecated, running any
140-
cargo action on `bar` will emit a warning unless `barred` is also marked
141-
`deprecated.
136+
should produce a warning that contains the `note`. This warning should not be
137+
emitted for crates that reexport the feature under a feature also marked
138+
deprecated. For example: crate `foo` exports feature `phooey`, and crate `bar`
139+
exports feature `barred = ["foo/phooey"]`. If `foo` markes `bar` as deprecated,
140+
running any cargo action on `bar` will emit a warning unless `barred` is also
141+
marked `deprecated.
142142

143143
Accessing this information will require access to the manifest.
144144

145+
### A note on `since`
146+
147+
The exact behavior of the `since` key is not provided in this RFC as there are
148+
decisions related to resolution that need to be made. The generally accepted
149+
concept is that there should be a warning if a deprecated feature is used _and_
150+
there is something actionable to resolve this issue for all downstream crates -
151+
but the details of how best to do this are not yet clear. Please see [discussion
152+
on since].
153+
154+
If the exact behavior of `since` does not reach consensus before `deprecated` is
155+
nearing stabilization, this key can stabilized separately or dropped entirely.
156+
157+
145158
## `public`
146159

147160
`public` is a boolean value that defaults to `true`. It can be thought of as
@@ -313,8 +326,8 @@ ignore this key, newer Cargo would be able to merge `features`, `features2`, and
313326
- Should there be a simple `--allow-private-features` flag that allows using
314327
all features, such as for crater runs? This can be decided during
315328
implementation.
316-
- How should `since` work with the `deprecated` key? This can be decided
317-
during implementation or droped entirely.
329+
- How should `since` work with the `deprecated` key? See
330+
[a note on `since`](#a-note-on-since) for further information.
318331

319332
It is worth noting that not all of these new keys need to be made available at
320333
once. `enables` needs to be implemented first, but support for all others could
@@ -361,7 +374,8 @@ be added over time.
361374
[cargo #10882]: https://github.com/rust-lang/cargo/issues/10882
362375
[`cargo-info`]: https://github.com/rust-lang/cargo/issues/948
363376
[`deprecated`]: https://doc.rust-lang.org/reference/attributes/diagnostics.html#the-deprecated-attribute
364-
[`deprecated-suggestions`]: https://github.com/rust-lang/rust/issues/94785#issuecomment-1579349116
377+
[`deprecated-suggestions`]: https://github.com/rust-lang/rust/issues/94785
378+
[discussion on since]: https://github.com/rust-lang/rfcs/pull/3416#discussion_r1172895497
365379
[`public_private_dependencies`]: https://rust-lang.github.io/rfcs/1977-public-private-dependencies.html
366380
[`rustdoc-cargo-configuration`]: https://github.com/rust-lang/rfcs/pull/3421
367381
[`tokio`]: https://docs.rs/crate/tokio/latest/features

0 commit comments

Comments
 (0)