unsafe -> unstable

This commit is contained in:
Philipp Oppermann
2019-06-26 18:14:33 +02:00
parent 7abd49dc56
commit 3178be619e

View File

@@ -341,7 +341,7 @@ fn alloc_error_handler(layout: alloc::alloc::Layout) -> ! {
}
```
The `alloc_error_handler` function is still unsafe, so we need a feature gate to enable it. The function receives a single argument: the `Layout` instance that was passed to `alloc` when the allocation failure occurred. There's nothing we can do to resolve that failure, so we just panic with a message that contains the `Layout` instance.
The `alloc_error_handler` function is still unstable, so we need a feature gate to enable it. The function receives a single argument: the `Layout` instance that was passed to `alloc` when the allocation failure occurred. There's nothing we can do to resolve that failure, so we just panic with a message that contains the `Layout` instance.
With this function, compilation errors should be fixed. Now we can use the allocation and collection types of `alloc`, for example we can use a [`Box`] to allocate a value on the heap: