Skip to content

docs: Remove statement that dep features are optional #15408

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

floers
Copy link

@floers floers commented Apr 8, 2025

I created my own registry by using a git repo and found that leaving the features in the dependencies in an index entry does not work. When a crate A has dependencies with features and you try to use it via the registry in crate B the build fails when A uses symbols only available by said features.

I tested with with 1.86

@rustbot
Copy link
Collaborator

rustbot commented Apr 8, 2025

r? @weihanglo

rustbot has assigned @weihanglo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-documenting-cargo-itself Area: Cargo's documentation S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 8, 2025
@@ -139,7 +139,6 @@ explaining the format of the entry.
// https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html.
"req": "^0.6",
// Array of features (as strings) enabled for this dependency.
// May be omitted since Cargo 1.84.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The doc might be a bit ambiguous. By looking at #14838 and #14839, this omitting means, if empty then you can omit this.

If a package has a features, then the field cannot be omitted.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you = give a concrete example of the failing case, and the step to produce?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documenting-cargo-itself Area: Cargo's documentation S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants