Skip to content

SIGABRT from malformed cfg in a closure #79829

Closed

Description

fn bug() {
    let _ = || {
        #[cfg(not(target_arch == "x86"))] {}
    };
}

when compiled (this works on nightly and beta, so I presume it also happens on stable), this produces:

error: expected one of `(`, `)`, `,`, `::`, or `=`, found `==`
 --> src\lib.rs:3:31
  |
3 |         #[cfg(not(target_arch == "x86"))] {}
  |                               ^^ expected one of `(`, `)`, `,`, `::`, or `=`

error: could not compile `testlib`

Caused by:
  process didn't exit successfully: `rustc --crate-name testlib --edition=2018 src\lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=0ff8eeface1c2012 -C extra-filename=-0ff8eeface1c2012 --out-dir C:\Users\aaron\Documents\github\testlib\target\debug\deps -C incremental=C:\Users\aaron\Documents\github\testlib\target\debug\incremental -L dependency=C:\Users\aaron\Documents\github\testlib\target\debug\deps` (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN)

Backtrace does not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-parserArea: The parsing of Rust source code to an ASTC-bugCategory: This is a bug.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.P-mediumMedium priorityT-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

    No branches or pull requests

    Issue actions