Skip to content

rustc --cfg=')' exits without error #73026

@ogoffart

Description

@ogoffart
Contributor

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

Activity

added
C-bugCategory: This is a bug.
I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
on Jun 5, 2020
added
A-diagnosticsArea: Messages for errors, warnings, and lints
and removed
I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
on Jun 5, 2020
meithecatte

meithecatte commented on Jan 1, 2022

@meithecatte
Contributor

@rustbot claim

added 2 commits that reference this issue on Jan 1, 2022
193342e
2004a51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @ogoffart@jonas-schievink@meithecatte

    Issue actions

      `rustc --cfg=')' ` exits without error · Issue #73026 · rust-lang/rust