Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
caoweinian opened this issue Jul 6, 2022 · 3 comments · May be fixed by #5341
Closed

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

caoweinian opened this issue Jul 6, 2022 · 3 comments · May be fixed by #5341
Labels
a-macros bug Panic, non-idempotency, invalid code, etc. duplicate

Comments

@caoweinian
Copy link

caoweinian commented Jul 6, 2022

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

@caoweinian caoweinian changed the title abort: memory allocation of <tons of> bytes failed Aborted using cfg-if: memory allocation of <tons of> bytes failed Jul 6, 2022
@ytmimi
Copy link
Contributor

ytmimi commented Jul 6, 2022

Thanks for reaching out.

I believe this may be a duplicate of #4442. I just checked and this looks to be resolved by #5341, which is still under review.

@ytmimi
Copy link
Contributor

ytmimi commented Jul 6, 2022

I added a test case for this in #5341. Testing locally things work fine so we'll just need to see if things pass in CI.

@ytmimi ytmimi added a-macros duplicate bug Panic, non-idempotency, invalid code, etc. labels Jul 6, 2022
@ytmimi
Copy link
Contributor

ytmimi commented Jul 27, 2022

going to close this as a duplicate of #4442. I'd follow that issue or PR #5341 to see when the fix is merged.

@ytmimi ytmimi closed this as not planned Won't fix, can't repro, duplicate, stale Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-macros bug Panic, non-idempotency, invalid code, etc. duplicate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants