diff options
| author | Amanieu d'Antras <amanieu@gmail.com> | 2025-05-18 13:01:35 +0200 |
|---|---|---|
| committer | Amanieu d'Antras <amanieu@gmail.com> | 2025-07-01 18:25:30 +0200 |
| commit | 15bd619d5f12b4d01bb645340e7eea97d7b0e7c7 (patch) | |
| tree | 60e48b4aa5b331bbdca7a32c899c1e5b97129648 /compiler/rustc_parse/src/errors.rs | |
| parent | f19142044f270760ce0ebc03b2c3a44217d8703d (diff) | |
| download | rust-15bd619d5f12b4d01bb645340e7eea97d7b0e7c7.tar.gz rust-15bd619d5f12b4d01bb645340e7eea97d7b0e7c7.zip | |
Change `{Box,Arc,Rc,Weak}::into_raw` to only work with `A = Global`
Also applies to `Vec::into_raw_parts`. The expectation is that you can round-trip these methods with `from_raw`, but this is only true when using the global allocator. With custom allocators you should instead be using `into_raw_with_allocator` and `from_raw_in`. The implementation of `Box::leak` is changed to use `Box::into_raw_with_allocator` and explicitly leak the allocator (which was already the existing behavior). This is because, for `leak` to be safe, the allocator must not free its underlying backing store. The `Allocator` trait only guarantees that allocated memory remains valid until the allocator is dropped.
Diffstat (limited to 'compiler/rustc_parse/src/errors.rs')
0 files changed, 0 insertions, 0 deletions
