-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Add rustc --run #9826
Comments
Also useful would be |
Is adding all the old |
I don't think we should have more than one official tool for the same functionality. Either we should commit to moving everything we have now behind a |
I was thinking that
In the latter case
|
Has there been any updates for the compile+execute functionality? Similar to |
I got a minimal working implementation here. Feedback welcome. N.B. I decided to wrap |
I think we should store the compiled binaries to boost the performance. That way it could easily replace small Python scripts and actually be faster to execute. When running a rust script (with rustic shebang) called I would like to see this behaviour merged to the main project. |
It's not that simple. It would need to verify that none of the modules or crates it depends on changed, along with making sure |
|
No, it does not (at least not in its current incarnation). The purpose of |
I do agree the rust compiler should be able to run rust code. |
This issue is a feature request, and needs an approved RFC to be implemented. It should be moved to the rust-lang/rfcs repo. (As per the issues policy) cc @nick29581 |
I don't think compiler features (cf language features) need an RFC unless they are very far reaching. Leaving here for now. |
Triage: no comments in a long time. https://github.com/DanielKeep/cargo-script can be used in a shebang line, and includes Cargo stuff as well. |
Tried cargo run 😞 but it seems that you need Cargo.toml file:
I agree there should be some kind of command that abstracts away the compilation part. I'm not sure this has something to do with cargo. Maybe adding a rust command:
By also adding a shebang:
We can execute by simply:
This allows distributing via compiled binaries via cargo-script is ok but is not installed by default. I'm not sure that the all the verbosity is needed:
|
I am going to give this one a close, as |
Leaves the |
@steveklabnik As pointed earlier |
For the sake of posterity and documenting some history, here's where the and here's where the |
For those wondering what Steve refers to as |
As for now, it is not clear if |
This is a great idea I love it will they implement it? |
wow! 8 years, that is some powerful user unfriendliness. |
It's annoying. A handy fix can be found in here: http://blog.joncairns.com/2015/10/a-single-command-to-compile-and-run-rust-programs/. Create a bash script named
|
Add semicolon-outside/inside-block lints changelog: Add `semicolon_outside_block` and `semicolon_inside_block` lints Fixes rust-lang/rust-clippy#7322 An earlier attempt at this can be found here rust-lang/rust-clippy#7564. This PR still implements two separate lints but I am open to merging them into a single one that's configurable.
With the removal of the
rust
tool, there is nothing good to place in the initial hashbang comment in a Rust file (you used to be putrust run
in there).rustc --run
should be added to fill that gap.The use case, of course, is some kind support for script-like usage for Rust which will become attractive when the compilation speed improves.
The text was updated successfully, but these errors were encountered: