<p dir="auto">I create a new project using <code class="notranslate">cargo new hello_world --bin</code>, and then run <code class="notranslate">cargo build -v</code>, but get the following error.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Process didn't exit successfully: `rustc - --crate-name - --crate-type dylib --crate-type bin --print=file-names` (status=101)
--- stderr
error: crate name cannot start with a hyphen: -
error: aborting due to previous error"><pre class="notranslate"><code class="notranslate">Process didn't exit successfully: `rustc - --crate-name - --crate-type dylib --crate-type bin --print=file-names` (status=101)
--- stderr
error: crate name cannot start with a hyphen: -
error: aborting due to previous error
</code></pre></div>
<p dir="auto">This error just started appearing since I updated to the latest nightly.</p>
<p dir="auto">Incidentally, there seems to be no different to the <code class="notranslate">Cargo.toml</code> file or directory structure or indeed <code class="notranslate">main.rs</code> file, regardless of whether I specify the <code class="notranslate">--bin</code> option or not to <code class="notranslate">cargo new</code>. Is this right?</p>
<p dir="auto">With a fresh build of both rustc and cargo, <code class="notranslate">cargo build</code> and other similar commands are executing <code class="notranslate">rustc</code> somewhere along the way with the crate name <code class="notranslate">-</code>, which is completely forbidden since <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="58495429" data-permission-text="Title is private" data-url="https://github.com/rust-lang/rust/issues/22664" data-hovercard-type="pull_request" data-hovercard-url="/rust-lang/rust/pull/22664/hovercard" href="https://github.com/rust-lang/rust/pull/22664">rust-lang/rust#22664</a> landed a few hours ago. I guess it used to work in some manner or other but is now a non-zero exit code propagating to cause failure of the build.</p>
<p dir="auto">This is happening on all my libraries, regardless of any dependencies they may or may not have.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ cargo build --verbose
Process didn't exit successfully: `rustc - --crate-name - --crate-type dylib --crate-type bin --print=file-names` (status=101)
--- stderr
error: crate name cannot start with a hyphen: -
error: aborting due to previous error"><pre class="notranslate"><code class="notranslate">$ cargo build --verbose
Process didn't exit successfully: `rustc - --crate-name - --crate-type dylib --crate-type bin --print=file-names` (status=101)
--- stderr
error: crate name cannot start with a hyphen: -
error: aborting due to previous error
</code></pre></div>
<ul dir="auto">
<li>cargo 0.0.1-pre (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/rust-lang/cargo/commit/b6c07a62991a2954ca501638fcb000555add4a77/hovercard" href="https://github.com/rust-lang/cargo/commit/b6c07a62991a2954ca501638fcb000555add4a77"><tt>b6c07a6</tt></a> 2015-02-24 00:28:31 +0000)</li>
<li>rustc 1.0.0-dev (91a5a1ab4 2015-02-23) (built 2015-02-24)</li>
</ul>