Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 2 Packages Projects Releases Wiki Activity
Files
3cfb6bc73a429a67f87c6542de2b8f9395cf4b94
rust/src/test/ui/feature-gates/feature-gate-alloc-error-handler.rs

15 lines
278 B
Rust
Raw Normal View History

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`.
2018-07-06 15:49:52 +02:00
// compile-flags:-C panic=abort
#![no_std]
#![no_main]
use core::alloc::Layout;
normalize use of backticks in compiler messages for libsyntax/feature_gate https://github.com/rust-lang/rust/issues/60532
2019-07-09 11:32:08 +02:00
#[alloc_error_handler] //~ ERROR `#[alloc_error_handler]` is an unstable feature
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`.
2018-07-06 15:49:52 +02:00
fn oom(info: Layout) -> ! {
loop {}
}
Make sure feature gate errors are recoverable (take 2)
2019-01-02 17:14:24 +03:00
#[panic_handler]
fn panic(_: &core::panic::PanicInfo) -> ! { loop {} }
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 1339ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API