Description
Code
Running the command rustc --cfg=']'
exits without any meaningful error.
Meta
rustc --version --verbose
:
rustc 1.43.0 (4fb7144ed 2020-04-20)
binary: rustc
commit-hash: 4fb7144ed159f94491249e86d5bbd033b5d60550
commit-date: 2020-04-20
host: x86_64-unknown-linux-gnu
release: 1.43.0
LLVM version: 9.0
Also reproduced on godbold.org with the 1.45 nightly.
Changing version on godbold.org shows the problem start occuring in 1.39.
(rustc 1.38 properly give an error)
Background
I had a typo in my build.rs script, it looked something like that:
println!("cargo:rustc-cfg=something_something=\"{}\"]", something.something());
cargo build
was then simply giving me an single meaningless error
error: could not compile `mycrate`.
I then had to try bisecting the code trying to find out where was the problem (as i had many change both in the build script and in the actual crate, it was not obvious what was the problem) until i found out the leftover ']' which was there from a copy paste from a line in https://doc.rust-lang.org/cargo/reference/build-scripts.html#outputs-of-the-build-script