Skip to content

Commit 941b123

Browse files
committed
Auto merge of #9877 - dswij:fix-init-bin-help, r=ehuss
Update suggestion message on bad project name error closes #9876 Error message suggest adding `[bin]` to `Cargo.toml` which should be `[[bin]]` instead.
2 parents a007f97 + cb2932e commit 941b123

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/cargo/ops/cargo_new.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ fn check_name(
185185
This can be done by setting the binary filename to `src/bin/{name}.rs` \
186186
or change the name in Cargo.toml with:\n\
187187
\n \
188-
[bin]\n \
188+
[[bin]]\n \
189189
name = \"{name}\"\n \
190190
path = \"src/main.rs\"\n\
191191
",

tests/testsuite/init.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ and set the binary name to be different from the package. \
290290
This can be done by setting the binary filename to `src/bin/foo.bar.rs` \
291291
or change the name in Cargo.toml with:
292292
293-
[bin]
293+
[[bin]]
294294
name = \"foo.bar\"
295295
path = \"src/main.rs\"
296296
@@ -317,7 +317,7 @@ and set the binary name to be different from the package. \
317317
This can be done by setting the binary filename to `src/bin/test.rs` \
318318
or change the name in Cargo.toml with:
319319
320-
[bin]
320+
[[bin]]
321321
name = \"test\"
322322
path = \"src/main.rs\"
323323

tests/testsuite/new.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ and set the binary name to be different from the package. \
121121
This can be done by setting the binary filename to `src/bin/foo.rs.rs` \
122122
or change the name in Cargo.toml with:
123123
124-
[bin]
124+
[[bin]]
125125
name = \"foo.rs\"
126126
path = \"src/main.rs\"
127127
@@ -143,7 +143,7 @@ and set the binary name to be different from the package. \
143143
This can be done by setting the binary filename to `src/bin/test.rs` \
144144
or change the name in Cargo.toml with:
145145
146-
[bin]
146+
[[bin]]
147147
name = \"test\"
148148
path = \"src/main.rs\"
149149
@@ -188,7 +188,7 @@ and set the binary name to be different from the package. \
188188
This can be done by setting the binary filename to `src/bin/pub.rs` \
189189
or change the name in Cargo.toml with:
190190
191-
[bin]
191+
[[bin]]
192192
name = \"pub\"
193193
path = \"src/main.rs\"
194194
@@ -210,7 +210,7 @@ and set the binary name to be different from the package. \
210210
This can be done by setting the binary filename to `src/bin/core.rs` \
211211
or change the name in Cargo.toml with:
212212
213-
[bin]
213+
[[bin]]
214214
name = \"core\"
215215
path = \"src/main.rs\"
216216
@@ -322,7 +322,7 @@ and set the binary name to be different from the package. \
322322
This can be done by setting the binary filename to `src/bin/10-invalid.rs` \
323323
or change the name in Cargo.toml with:
324324
325-
[bin]
325+
[[bin]]
326326
name = \"10-invalid\"
327327
path = \"src/main.rs\"
328328
@@ -443,7 +443,7 @@ and set the binary name to be different from the package. \
443443
This can be done by setting the binary filename to `src/bin/ⒶⒷⒸ.rs` \
444444
or change the name in Cargo.toml with:
445445
446-
[bin]
446+
[[bin]]
447447
name = \"ⒶⒷⒸ\"
448448
path = \"src/main.rs\"
449449
@@ -463,7 +463,7 @@ and set the binary name to be different from the package. \
463463
This can be done by setting the binary filename to `src/bin/a¼.rs` \
464464
or change the name in Cargo.toml with:
465465
466-
[bin]
466+
[[bin]]
467467
name = \"\"
468468
path = \"src/main.rs\"
469469

0 commit comments

Comments
 (0)