Skip to content

Aborted using cfg-if: memory allocation of <tons of> bytes failed #5428

@caoweinian

Description

@caoweinian

origin: https://internals.rust-lang.org/t/cargo-fmt-failed-with-infinite-memory-request/16950

Using cargo fmt to format the following code causes the process to be aborted with one line error message: "memory allocation of <tons of> bytes failed":

// cfg-if: version 1.0.0
cfg_if::cfg_if! {
    if #[cfg(windows)] {
        compile_error!{"..."};
    }
}

rustc/cargo: 1.62.0
rustfmt: 1.4.38-stable

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-macrosbugPanic, non-idempotency, invalid code, etc.duplicate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions