2 ms·
No, you can't - they don't exist in Rust for Linux. In Rust the alloc library's Vec has a function Vec::push(&mut self, value: T) https://doc.rust-lang.org/st
by tialaramex 4y ago
No, you can't - they don't exist in Rust for Linux.
In Rust the alloc library's Vec has a function Vec::push(&mut self, value: T)
https://doc.rust-lang.org/std/vec/struct.Vec.html#method.push https://doc.rust-lang.org/std/vec/struct.Vec.html#method.pus...
In Rust for Linux their custom alloc library does not have that function offering instead Vec::try_push(&mut self, value: T) -> Result<(), TryReserveError>
https://rust-for-linux.github.io/docs/alloc/vec/struct.Vec.html#method.try_push https://rust-for-linux.github.io/docs/alloc/vec/struct.Vec.h...
- kaba0 4y agoWhat’s up with the Allocator API? Then it could be Vec::push<Allocator>(..), giving it an always-failing one for example.
- tialaramex 4y agoVec::push<Allocator>(..) makes no sense, the Allocator is a parameter to the Vec type.
- kaba0 4y agoThat’s what I meant to write
- tialaramex 4y agoOK and... ? What purpose does an always-failing allocator for Vec have? I guess maybe it's useful for some unit testing cases, but otherwise it seems pointless.