You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
0 commit comments