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

Target's required-features should be automatically passed to a run configuration #6262

Closed
vlad20012 opened this issue Oct 15, 2020 · 0 comments · Fixed by #6324
Closed

Target's required-features should be automatically passed to a run configuration #6262

vlad20012 opened this issue Oct 15, 2020 · 0 comments · Fixed by #6324
Assignees
Labels

Comments

@vlad20012
Copy link
Member

vlad20012 commented Oct 15, 2020

Consider Cargo.toml:

[package]
name = "example_project"
version = "0.1.0"
authors = []
edition = "2018"

[[bin]]
name = "main"
path = "src/main.rs"
required-features = ["baz"]

[features]
baz = []

and src/main.rs:

fn main() { println!("Hello, World!") }

Then, if I run this main, the plugin creates a cargo run configuration with a command run --package example_project --bin main that fails with this error:

> cargo build --color=always --package example_project --bin main --message-format=json
error: target `main` in package `example_project` requires the features: `baz`
Consider enabling them by passing, e.g., `--features="baz"`

The plugin should automatically add this --features="baz" to a run configuration using CargoWorkspace.Target.requiredFeatures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants