News for hackers. Stuff that matters.
Re:Rust in the 6.2 Kernel by tialaramex on Friday November 18, 2022 @01:15PM (#33659161)
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.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.h...

Re:Rust in the 6.2 Kernel by kaba0 on Saturday November 19, 2022 @12:12PM (#33672085)
What’s up with the Allocator API? Then it could be Vec::push<Allocator>(..), giving it an always-failing one for example.
Re:Rust in the 6.2 Kernel by tialaramex on Saturday November 19, 2022 @02:37PM (#33673785)
Vec::push<Allocator>(..) makes no sense, the Allocator is a parameter to the Vec type.
Re:Rust in the 6.2 Kernel by kaba0 on Saturday November 19, 2022 @08:03PM (#33676945)
That’s what I meant to write
Re:Rust in the 6.2 Kernel by tialaramex on Tuesday November 22, 2022 @04:15AM (#33703713)
OK 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.