Uh oh!
There was an error while loading. Please reload this page.
Implement #[alloc_error_handler] - #52191
Conversation
…h ABI of the declaration in liballoc This turned out to be important on Windows. Calling `handle_alloc_error(Layout::new::<[u8; 42]>())` caused: ``` Exception thrown at 0x00007FF7C70DC399 in a.exe: 0xC0000005: Access violation reading location 0x000000000000002A. ``` 0x2A equals 42, so it looks like the `Layout::size` field of type `usize` was interpreted as a pointer to read from.
This to-be-stable attribute is equivalent to `#[lang = "oom"]`. It is required when using the alloc crate without the std crate. It is called by `handle_alloc_error`, which is in turned called by "infallible" allocations APIs such as `Vec::push`.
rust-highfive
commented
Jul 9, 2018
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
SimonSapin
commented
Jul 9, 2018
Kudos to @ollie27 for catching the ABI mismatch (fixed in the first commit) #52110 (comment). This turned out to be the reason why the new test (now second commit) failed on Windows at #52110 (comment). Calling 0x2A equals 42, so it looks like the |
alexcrichton
commented
Jul 9, 2018
@bors: r+ |
bors
commented
Jul 9, 2018
📌 Commit 239ec7d has been approved by |
bors
commented
Jul 10, 2018
⌛ Testing commit 239ec7d with merge 08fe845e78253595c097779dfc5b8f20e007dc6d... |
bors
commented
Jul 10, 2018
💔 Test failed - status-appveyor |
SimonSapin
commented
Jul 10, 2018
@bors retry |
bors
commented
Jul 10, 2018
Implement #[alloc_error_handler] This to-be-stable attribute is equivalent to `#[lang = "oom"]`. It is required when using the `alloc` crate without the `std` crate. It is called by `handle_alloc_error`, which is in turned called by "infallible" allocations APIs such as `Vec::push`.
bors
commented
Jul 10, 2018
☀️ Test successful - status-appveyor, status-travis |
This to-be-stable attribute is equivalent to
#[lang = "oom"]. It is required when using thealloccrate without thestdcrate. It is called byhandle_alloc_error, which is in turned called by "infallible" allocations APIs such asVec::push.