Re: [PATCH 1/6] rust: alloc: add Vec::push_init

From: Eliot Courtney

Date: Wed Aug 26 2026 - 10:19:24 EST


> So concretely, what about just:
> - push(&mut self, init: impl Init<T>, flags: Flags) ->
> Result<(), AllocError>
> - try_push<I: Init<T, E>, E>(&mut self, init: I, flags: Flags) ->
> Result<(), PushInitError<I, E>>

I realised that changing push(v: T) to push(init: impl Init<T>) can
weaken the type inference, although there doesn't appear to be any uses
in tree that are affected currently. Anyone have any thoughts on this?
Otherwise I guess it's push, push_init, try_push_init (but with the
error types I suggested).