-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add support for custom allocators in Vec
#78461
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
This comment has been minimized.
This comment has been minimized.
@bors try |
⌛ Trying commit 51f24f6522615182ddb866e0cdcdccaf30968a13 with merge 1b5ce95284bc3170a1f4a55c6ec8a06b3e85ff73... |
☀️ Try build successful - checks-actions |
@craterbot check |
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🎉 Experiment
|
The Allocator WG has a roadmap here that this all fits into: rust-lang/wg-allocators#7 This is implementing this part of the relevant RFC. The linked issue about an allocator-aware |
The linked pull request #71873 was used to test, if a crater run will break anything and was never supposed to be merged. |
Yeh, I haven’t been closely following the Allocators WG so when I first saw this PR I thought it looked like a really big change compared to the amount of context we had in the OP, so thought I’d drop in a few links to things I found while trying to catch up 🙂 Is there any other background that might be good to have here? |
Yeah, very true, I added the roadmap to the OP. Just before #77187 we solved all blocking issues on the roadmap to keep the generic parameter unstable. |
@bors r+ rollup=never |
📌 Commit 51f24f6522615182ddb866e0cdcdccaf30968a13 has been approved by |
⌛ Testing commit 51f24f6522615182ddb866e0cdcdccaf30968a13 with merge f66719d68b1307db83077cee8730efc8a8767128... |
💔 Test failed - checks-actions |
Can't really say, why this failed. Somehow, // lldb-command:print hash_map
// lldbg-check:[...]$2 = size=4 { [0] = { 0 = 1 1 = 10 } [1] = { 0 = 2 1 = 20 } [2] = { 0 = 3 1 = 30 } [3] = { 0 = 4 1 = 40 } }
// lldbr-check:(std::collections::hash::map::HashMap<u64, u64, [...]>) hash_map = size=4 size=4 { [0] = { 0 = 1 1 = 10 } [1] = { 0 = 2 1 = 20 } [2] = { 0 = 3 1 = 30 } [3] = { 0 = 4 1 = 40 } }
|
@bors retry |
☀️ Test successful - checks-actions |
Is there some place for discussing the fact that these changes break the layout and ABI of |
I would assume that any such guarantees only apply to literally |
I'd say this applies to any |
@oli-obk Thanks! |
Fix regressed test due to rust-lang/rust#78461
… r=Amanieu Remove duplicated fn(Box<[T]>) -> Vec<T> `<[T]>::into_vec()` does the same thing as `Vec::from::<Box<[T]>>()`, so they can be implemented in terms of each other. This was the previous implementation of `Vec::from()`, but was changed in rust-lang#78461. I'm not sure what the rationale was for that change, but it seems preferable to maintain a single implementation.
… r=Amanieu Remove duplicated fn(Box<[T]>) -> Vec<T> `<[T]>::into_vec()` does the same thing as `Vec::from::<Box<[T]>>()`, so they can be implemented in terms of each other. This was the previous implementation of `Vec::from()`, but was changed in rust-lang#78461. I'm not sure what the rationale was for that change, but it seems preferable to maintain a single implementation.
… r=Amanieu Remove duplicated fn(Box<[T]>) -> Vec<T> `<[T]>::into_vec()` does the same thing as `Vec::from::<Box<[T]>>()`, so they can be implemented in terms of each other. This was the previous implementation of `Vec::from()`, but was changed in rust-lang#78461. I'm not sure what the rationale was for that change, but it seems preferable to maintain a single implementation.
This follows the roadmap of the allocator WG to add custom allocators to collections.
r? @Amanieu
This pull request requires a crater run.
Prior work:
alloc-wg
-crate