Support creating default Vec within a custom allocator#154990
Support creating default Vec within a custom allocator#154990Nokel81 wants to merge 1 commit intorust-lang:mainfrom
Conversation
|
rustbot has assigned @Mark-Simulacrum. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
@rustbot modify label: +I-libs-api-nominated |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
This breaks type inference unfortunately. |
Is that because of the lack of defaults within |
|
Type inference unfortunately ignores defaults entirely. This is also why for example |
From reading the docs I was thinking that it would be possible to mark |
|
I don't believe that is possible, but I did be happy to be proven wrong. |
|
@rustbot author Feel free to mark as waiting on review if you find a solution (I don't have the bandwidth to help search for one unfortunately). Maybe asking on Zulip is a reasonable starting point. |
|
Reminder, once the PR becomes ready for a review, use |
|
Per discussion in the last @rust-lang/libs-api meeting, this would be nice to add but we don't think it's possible without extensive breakage due to how inference currently works. This will be brought up with the edition team as there may be some way to allow this - it would certainly be useful! - but unfortunately this PR is going to be blocked on that at a minimum. Thanks ^^ |
This PR adds support for calling
Default::defaultfor someVec<T, A>as long as theAalso implementsDefault.