-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Safety comment on Allocator trait likely incorrect #107040
Copy link
Copy link
Closed
Labels
A-allocatorsArea: Custom and system allocatorsArea: Custom and system allocatorsA-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and tools
Metadata
Metadata
Assignees
Labels
A-allocatorsArea: Custom and system allocatorsArea: Custom and system allocatorsA-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and tools
Type
Fields
Give feedbackNo fields configured for issues without a type.
one of the safety requirements for the
Allocatortrait is:rust/library/core/src/alloc/mod.rs
Lines 97 to 99 in a28f3c8
afaict that's incorrect since, because of the validity requirements, it requires Allocators to never free any memory blocks until the Allocator and all clones are dropped.
It should instead be something like: