-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
New defaults to bin #5029
New defaults to bin #5029
Conversation
Will updating the Cargo book be done separately? It's not clear to me how that is published. |
4137497
to
da8012c
Compare
An excellent comment @ehuss! I've updated the docs to mention both I am almost sure that this is not the only one place in the docs which needs to be updated though :( Let's cc @steveklabnik just in case :) |
@@ -7,7 +7,7 @@ $ cargo new hello_world --bin | |||
``` | |||
|
|||
We’re passing `--bin` because we’re making a binary program: if we | |||
were making a library, we’d leave it off. | |||
were making a library, we’d pass `--lib`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think src/doc/src/guide/creating-a-new-project.md
also needs to be updated, since it talks about --bin
in more detail.
da8012c
to
9cb10e6
Compare
cc @rust-lang/cargo Big +1 on this change, I'd like to get it in the same beta as the other change to cargo new, but I know we cut a beta soon so maybe the other change should be held back. We should be very proactive about announcing this change. Not only do our docs need to change, we also need to inform other people who may be teaching Rust of the change to the default behavior, since they'll likely be walking people through this as a first step. |
@bors r+
|
📌 Commit 9cb10e6 has been approved by |
⌛ Testing commit 9cb10e6 with merge 1780cdf6436f1567bbb90cb9337b6af73643dba3... |
💡 This pull request was already approved, no need to approve it again.
|
📌 Commit 9cb10e6 has been approved by |
⌛ Testing commit 9cb10e6 with merge 7320c305e981f24e7fa3cb2d07ce58358256ca8d... |
💡 This pull request was already approved, no need to approve it again.
|
📌 Commit 9cb10e6 has been approved by |
New defaults to bin So this switches `cargo new` default from `--lib` to `--bin`, as discussed on IRC. The first two commits are just refactorings, and the last one actually flips the switch. Surprisingly enough, no tests need to be modified it seems! r? @withoutboats
☀️ Test successful - status-appveyor, status-travis |
@matklad got here from TWIR, I was wondering if the reasoning was recorded anywhere other than IRC? I'm just curious what the reasoning was. |
@pwoolcoc sure, #5013 (comment) I believe is the most recent discussion (it includes the link to urlo post as well). The TL;DR is
|
@matklad thanks! |
What do you think about allowing You know what you will get and with less typing to boot. |
So this switches
cargo new
default from--lib
to--bin
, as discussed on IRC.The first two commits are just refactorings, and the last one actually flips the switch. Surprisingly enough, no tests need to be modified it seems!
r? @withoutboats