GlobalAlloc docs example crashes #81847
Labels
C-bug
Category: This is a bug.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
I cut and pasted the example for
GlobalAlloc
from the stdlib docs into the playground. Contrary to the implications in the documentation, the program does not run to completion. Instead, it printsI think this is fine behaviour. The example is wrong and should be fixed somehow.
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=54f5b4b24c19b64962d35ec4031ee4a5
I was doing this because I am trying to write a test case for the stdlib which involves a stunt allocator. So far myLooks like#[global_alloc]
annotation in a file inlibrary/std/tests/
does not seem to be effective. I suspect that whatever is getting in my way might also get in the way of adding a test case specifically for#[global_alloc]
.src/test/ui/
is the right place and I should read the dev docs...The example from
std::alloc::System
works correctly.The text was updated successfully, but these errors were encountered: