Skip to content

Commit e36b155

Browse files
committed
Add markdown vs. plaintext as an unresolved question
1 parent 88a3447 commit e36b155

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

text/0000-feature-metadata.md

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,10 @@ The following keys would be allowed in a feature table:
6969
- `doc`: A markdown docstring describing the feature. Like with `#[doc(...)]`,
7070
the first line will be treated as a summary.
7171
- `deprecated`: This can be either a simple boolean, a string, or an object
72-
with `since` and/or `note` keys. Cargo will warn downstream crates using this
72+
with `since` and/or `note` keys. Cargo will warn downstream crates using
73+
this feature.
7374
- `public`: A boolean flag defaulting to `true` that indicates whether or not
74-
downstream crates should be allowed to use this feature
75+
downstream crates should be allowed to use this feature.
7576

7677
If a downstream crate attempts to use the features `baz` and `qux`, they will
7778
see messages like the following:
@@ -104,7 +105,8 @@ provided (`requires = []`).
104105

105106
`doc` is the most straightforward: it accepts markdown-flavored text, and should
106107
be thought of as the equivalent to a `#[doc(...)]` attribute. Like doc comments,
107-
the first line should be treated as a summary.
108+
the first line should be treated as a summary. Intra-doc link support is not
109+
included in this RFC, so they should not be used.
108110

109111
There is nothing in this RFC that cargo `must` do with this action, since it is
110112
mainly intended for the consumption of `rustdoc` or `docs.rs`. However, it can
@@ -183,6 +185,12 @@ Full support does not need to happen immediately, since it will require this
183185
information be present in the index. [Index changes] describes how this can take
184186
place.
185187

188+
Two sample use cases for `public = false` include:
189+
190+
- `docs.rs` having a way to know which features should be hidden
191+
- Features that are included in feature chains (feature `a` enables feature
192+
`b`) but not meant for public consumption could be marked not public
193+
186194
# General Implementation & Usage
187195

188196
Use cases for this information will likely develop with time, but one of the
@@ -284,28 +292,23 @@ ignore this key, newer Cargo would be able to merge `features`, `features2`, and
284292
start with `_`, they are hidden from this table.
285293
- Ivy has a [visibility attribute] for its configuration (mentioned in
286294
[cargo #10882])
295+
- Discussion on stable/unstable/nightly-only features
296+
<https://github.com/rust-lang/cargo/issues/10881>
287297

288298
# Unresolved questions
289299

290300
[unresolved-questions]: #unresolved-questions
291301

292-
- Do we want all the proposed keys? Specifically, `public` may be more than
293-
what is needed.
294-
295-
See also:
296-
297-
- <https://github.com/rust-lang/cargo/issues/10882>
298-
- <https://github.com/rust-lang/cargo/issues/10881>
299-
300302
- If we use the semantics as-written, should there be a
301303
`--allow-private-features` flag? Or how should a user opt in?
302-
- Does it make sense to have separate `hidden` (not documented) and `public`
303-
(feature not allowed downstream) attribute? I think probably not
304-
- The Cargo index may need a way to be aware of deprecated features, so it can
305-
properly report them during resolution. What would be needed here?
306-
307-
It is worth noting that simpler keys (`requires`, `doc`, `deprecated`) could be
308-
stabilized immediately and other features could be postponed.
304+
- Rather than being consistent with `rustdoc` and accepting markdown, should
305+
the `doc` key be consistent with `package.description` and only support
306+
plain text? This RFC proposes making this decision at time of
307+
implementation, the challenges of supporting markdown are better understood.
308+
309+
It is worth noting that not all of these feature flags need to be made available
310+
at once. `requires` needs to be implemented first, but support for all others
311+
could be added over time.
309312

310313
# Future possibilities
311314

0 commit comments

Comments
 (0)