Skip to content
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

Examples requiring a nonexistent feature should be an error #4854

Closed
whitequark opened this issue Dec 22, 2017 · 3 comments · Fixed by #7950
Closed

Examples requiring a nonexistent feature should be an error #4854

whitequark opened this issue Dec 22, 2017 · 3 comments · Fixed by #7950
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself. A-features Area: features — conditional compilation C-bug Category: bug

Comments

@whitequark
Copy link
Member

I.e. this:

[features]
foo = []

[[example]]
name = "bar"
required-features = ["baz"]

currently just silently doesn't compile bar unless explicitly forced with cargo --example bar.

@alexcrichton alexcrichton added A-features Area: features — conditional compilation C-bug Category: bug labels Dec 22, 2017
lukaslueg added a commit to lukaslueg/cargo that referenced this issue Dec 29, 2017
Bin-, bench-, test- and example-targets may specify a set of required
features. Before this commit, it was possible to specify features not
declared in [features], which could be confusing in case of typos. This
is now a hard error during manifest-parsing.

Fixes rust-lang#4854
@stale
Copy link

stale bot commented Sep 18, 2018

As there hasn't been any activity here in over 6 months I've marked this as stale and if no further activity happens for 7 days I will close it.

I'm a bot so this may be in error! If this issue should remain open, could someone (the author, a team member, or any interested party) please comment to that effect?

The team would be especially grateful if such a comment included details such as:

  • Is this still relevant?
  • If so, what is blocking it?
  • Is it known what could be done to help move this forward?

Thank you for contributing!

(The cargo team is currently evaluating the use of Stale bot, and using #6035 as the tracking issue to gather feedback.)

If you're reading this comment from the distant future, fear not if this was closed automatically. If you believe it's still an issue please leave a comment and a team member can reopen this issue. Opening a new issue is also acceptable!

@stale stale bot added the stale label Sep 18, 2018
@dwijnand
Copy link
Member

The comment in the associated #4874 seems to indicate this issue is invalid?

Could someone with a slightly better understanding comment?

@stale stale bot removed the stale label Sep 18, 2018
@whitequark
Copy link
Member Author

@dwijnand No, this is not invalid. #4874 wasn't going far enough, it should have checked only features without / in them against the [features] section.

@ehuss ehuss added E-help-wanted A-diagnostics Area: Error and warning messages generated by Cargo itself. labels Feb 25, 2020
@bors bors closed this as completed in cdbd9b7 Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself. A-features Area: features — conditional compilation C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants