RustFmt takes entire ram when formatting simple(broken) file
Open
Nobody has claimed this yet.
C-bug
I-memory-usage
S-has-mcve
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 24
Description
rustfmt 1.5.2-nightly (a41fc00 2023-04-13)
File
cfg_if::cfg_if! {
if #[cfg(any(
all(target_arch = "wasm32", not(target_os = "wasi")),
target_arch = "asmjs"
))] {
#[cfg(all(feature = "stdweb", not(feature = "wasm-bindgen")))]
extern crate stdweb;
mod wasm;
pub use wasm::Instant;
pub use crate::wasm::now;
pub use wasm::SystemTime;
} else {
mod native;
pub use native::Instant;
%= pub use native::now;
}
}
will take 20GB ram and upset my oom killer which will kill process
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the report with rustfmt 1.5.2-nightly (a41fc00 2023-04-13) and the Rust snippet in the issue. Trace formatting of the malformed %= line and identify why memory grows; done means the input is handled without exhausting system memory.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100