#![feature(doc_keyword)]
#![feature(panic_info_message)]
#![cfg_attr(stage0, feature(panic_implementation))]
-#![cfg_attr(not(stage0), feature(panic_handler))]
#![feature(non_exhaustive)]
#![default_lib_allocator]
// RFC 2070: #[panic_implementation] / #[panic_handler]
(active, panic_implementation, "1.28.0", Some(44489), None),
- (active, panic_handler, "1.30.0", Some(44489), None),
// #[doc(keyword = "...")]
(active, doc_keyword, "1.28.0", Some(51315), None),
(accepted, proc_macro_path_invoc, "1.30.0", Some(38356), None),
// Allows all literals in attribute lists and values of key-value pairs.
(accepted, attr_literals, "1.30.0", Some(34981), None),
+ (accepted, panic_handler, "1.30.0", Some(44489), None),
);
// If you change this, please modify src/doc/unstable-book as well. You must
cfg_fn!(panic_implementation))),
// RFC 2070
- ("panic_handler", Normal, Gated(Stability::Unstable,
- "panic_handler",
- "#[panic_handler] is an unstable feature",
- cfg_fn!(panic_handler))),
+ ("panic_handler", Normal, Ungated),
("alloc_error_handler", Normal, Gated(Stability::Unstable,
"alloc_error_handler",
// no-prefer-dynamic
#![crate_type = "rlib"]
-#![feature(panic_handler)]
#![no_std]
use core::panic::PanicInfo;
// aux-build:some-panic-impl.rs
-#![feature(panic_handler)]
#![feature(lang_items)]
#![no_std]
#![no_main]
#![crate_type = "bin"]
#![feature(lang_items)]
-#![feature(panic_handler)]
#![no_main]
#![no_std]
// except according to those terms.
#![crate_type = "rlib"]
-#![feature(panic_handler)]
#![no_std]
use core::panic::PanicInfo;
#![crate_type = "bin"]
#![feature(lang_items)]
-#![feature(panic_handler)]
#![feature(const_panic)]
#![no_main]
#![no_std]
error: this constant cannot be used
- --> $DIR/const_panic_libcore_main.rs:20:1
+ --> $DIR/const_panic_libcore_main.rs:19:1
|
LL | const Z: () = panic!("cheese");
| ^^^^^^^^^^^^^^----------------^
| |
- | the evaluated program panicked at 'cheese', $DIR/const_panic_libcore_main.rs:20:15
+ | the evaluated program panicked at 'cheese', $DIR/const_panic_libcore_main.rs:19:15
|
= note: #[deny(const_err)] on by default
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error: this constant cannot be used
- --> $DIR/const_panic_libcore_main.rs:23:1
+ --> $DIR/const_panic_libcore_main.rs:22:1
|
LL | const Y: () = unreachable!();
| ^^^^^^^^^^^^^^--------------^
| |
- | the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic_libcore_main.rs:23:15
+ | the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic_libcore_main.rs:22:15
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error: this constant cannot be used
- --> $DIR/const_panic_libcore_main.rs:26:1
+ --> $DIR/const_panic_libcore_main.rs:25:1
|
LL | const X: () = unimplemented!();
| ^^^^^^^^^^^^^^----------------^
| |
- | the evaluated program panicked at 'not yet implemented', $DIR/const_panic_libcore_main.rs:26:15
+ | the evaluated program panicked at 'not yet implemented', $DIR/const_panic_libcore_main.rs:25:15
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
+++ /dev/null
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// compile-flags:-C panic=abort
-
-#![no_std]
-#![no_main]
-
-use core::panic::PanicInfo;
-
-#[panic_handler] //~ ERROR #[panic_handler] is an unstable feature (see issue #44489)
-fn panic(info: &PanicInfo) -> ! {
- loop {}
-}
+++ /dev/null
-error[E0658]: #[panic_handler] is an unstable feature (see issue #44489)
- --> $DIR/feature-gate-panic-handler.rs:18:1
- |
-LL | #[panic_handler] //~ ERROR #[panic_handler] is an unstable feature (see issue #44489)
- | ^^^^^^^^^^^^^^^^
- |
- = help: add #![feature(panic_handler)] to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0658`.
// no-prefer-dynamic
#![crate_type = "rlib"]
-#![feature(panic_handler)]
#![no_std]
use core::panic::PanicInfo;
// compile-flags:-C panic=abort
-#![feature(panic_handler)]
#![no_std]
#![no_main]
error: return type should be `!`
- --> $DIR/panic-handler-bad-signature-1.rs:22:6
+ --> $DIR/panic-handler-bad-signature-1.rs:21:6
|
LL | ) -> () //~ ERROR return type should be `!`
| ^^
error: argument should be `&PanicInfo`
- --> $DIR/panic-handler-bad-signature-1.rs:21:11
+ --> $DIR/panic-handler-bad-signature-1.rs:20:11
|
LL | info: PanicInfo, //~ ERROR argument should be `&PanicInfo`
| ^^^^^^^^^
// compile-flags:-C panic=abort
-#![feature(panic_handler)]
#![no_std]
#![no_main]
error: argument should be `&PanicInfo`
- --> $DIR/panic-handler-bad-signature-2.rs:21:11
+ --> $DIR/panic-handler-bad-signature-2.rs:20:11
|
LL | info: &'static PanicInfo, //~ ERROR argument should be `&PanicInfo`
| ^^^^^^^^^^^^^^^^^^
// compile-flags:-C panic=abort
-#![feature(panic_handler)]
#![no_std]
#![no_main]
error: function should have one argument
- --> $DIR/panic-handler-bad-signature-3.rs:20:1
+ --> $DIR/panic-handler-bad-signature-3.rs:19:1
|
LL | fn panic() -> ! { //~ ERROR function should have one argument
| ^^^^^^^^^^^^^^^
// compile-flags:-C panic=abort
-#![feature(panic_handler)]
#![no_std]
#![no_main]
error: should have no type parameters
- --> $DIR/panic-handler-bad-signature-4.rs:20:1
+ --> $DIR/panic-handler-bad-signature-4.rs:19:1
|
LL | / fn panic<T>(pi: &PanicInfo) -> ! {
LL | | //~^ ERROR should have no type parameters
// compile-flags:-C panic=abort
#![feature(lang_items)]
-#![feature(panic_handler)]
#![no_std]
#![no_main]
error[E0152]: duplicate lang item found: `panic_impl`.
- --> $DIR/panic-handler-duplicate.rs:26:1
+ --> $DIR/panic-handler-duplicate.rs:25:1
|
LL | / fn panic2(info: &PanicInfo) -> ! { //~ ERROR duplicate lang item found: `panic_impl`.
LL | | loop {}
| |_^
|
note: first defined here.
- --> $DIR/panic-handler-duplicate.rs:21:1
+ --> $DIR/panic-handler-duplicate.rs:20:1
|
LL | / fn panic(info: &PanicInfo) -> ! {
LL | | loop {}
#![feature(lang_items)]
#![feature(no_core)]
-#![feature(panic_handler)]
#![no_core]
#![no_main]
// error-pattern: duplicate lang item found: `panic_impl`.
-#![feature(panic_handler)]
use std::panic::PanicInfo;
error[E0152]: duplicate lang item found: `panic_impl`.
- --> $DIR/panic-handler-std.rs:18:1
+ --> $DIR/panic-handler-std.rs:17:1
|
LL | / fn panic(info: PanicInfo) -> ! {
LL | | loop {}
= note: first defined in crate `std`.
error: argument should be `&PanicInfo`
- --> $DIR/panic-handler-std.rs:18:16
+ --> $DIR/panic-handler-std.rs:17:16
|
LL | fn panic(info: PanicInfo) -> ! {
| ^^^^^^^^^
#![crate_type = "rlib"]
#![no_std]
-#![feature(panic_handler)]
#[panic_handler]
pub fn panic_fmt(_: &::core::panic::PanicInfo) -> ! {