From: bors Date: Tue, 17 Jan 2017 02:48:37 +0000 (+0000) Subject: Auto merge of #3542 - creativcoder:check-digit-name, r=alexcrichton X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~11^2~35 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a43403b3ec64cb4940250e02e616729e67e442f9;p=cargo.git Auto merge of #3542 - creativcoder:check-digit-name, r=alexcrichton Add a check for names starting with a digit According to Rust grammer https://doc.rust-lang.org/grammar.html#extern-crate-declarations for extern crate declarations, a crate name cannot start with a digit. But, currently this rule is not upheld by `cargo new` as creating a project like: `cargo new 2048` would create a project named 2048 which obviously won't compile with crate declaration like `extern crate 2048` by a consumer. This obviously is a rare case in practice, but its always good to check i guess. This PR adds a check to the `new` method and `bail`s out with a message for any names starting with a digit. PS: I noticed it while making a 2048 puzzle game as a library so thought it would be nice to add this check :) --- a43403b3ec64cb4940250e02e616729e67e442f9