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

cargo run could not determine which binary to run. Use the --bin option to specify a binary, or the default-run manifest key. #460

Open
geometryolife opened this issue Sep 19, 2022 · 5 comments

Comments

@geometryolife
Copy link

geometryolife commented Sep 19, 2022

When I use C-c C-c C-r to run the currently open program, this error will be reported, how can I fix it?

image

@brotzeit
Copy link
Contributor

You can either remove one of your binaries from your Cargo.toml or you can try adding the bin you want to run to rust-cargo-default-arguments. Why do you need two binaries ?

@geometryolife
Copy link
Author

This is actually a learning repository with many small projects created using cargo new, I want to run this small project after I open a small project, not run all the projects. If I don't use lsp it seems to work for my purpose, when I enable lsp it gives this error.

@brotzeit
Copy link
Contributor

It should be the same result when you run cargo run in your shell.

@geometryolife
Copy link
Author

geometryolife commented Sep 20, 2022

It should be the same result when you run cargo run in your shell.

image

If I run it in the shell, I get the correct result and no errors.
I think it's because rust-mode can't locate the nearest project's Cargo.tmol file when running the cargo run command.

@Afoxcute
Copy link

do you still need help?

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

No branches or pull requests

3 participants