oxc/crates/oxc_allocator
overlookmotel e87c0014b4 fix(allocator): statically prevent memory leaks in allocator (#8570)
Prevent memory leaks by statically preventing `Drop` types from being allocated in the arena.

Attempting to allocate any `Drop` type in the arena now produces a compilation failure.

The stabilization of `const {}` blocks in Rust 1.79.0 gave the mechanism required to enforce this at compile time without a mess of generics and traits, and in a way which should not hurt compile times (and zero runtime cost).

This PR is what discovered `CompactString`s being stored in arena in the mangler (fixed in #8557).

Note: The compilation failure occurs in `cargo build` not `cargo check`. So unfortunately errors don't appear in Rust Analyser, only when you run `cargo build`. From what I've read, stable Rust does not offer any solution to this at present. But the errors are reasonably clear what the problem is, and point to the line where it occurs.
2025-01-18 01:23:56 +00:00
..
src fix(allocator): statically prevent memory leaks in allocator (#8570) 2025-01-18 01:23:56 +00:00
Cargo.toml feat(allocator): add HashMap (#8553) 2025-01-16 23:29:57 +00:00
CHANGELOG.md release(crates): v0.45.0 (#8434) 2025-01-11 22:34:31 +08:00