1
Fork 0

stabilize #[panic_handler]

This commit is contained in:
Jorge Aparicio 2018-09-07 12:43:39 +02:00
parent 2ae11a9c22
commit 358fc5b621
25 changed files with 17 additions and 67 deletions

View file

@ -312,7 +312,6 @@
#![feature(doc_keyword)] #![feature(doc_keyword)]
#![feature(panic_info_message)] #![feature(panic_info_message)]
#![cfg_attr(stage0, feature(panic_implementation))] #![cfg_attr(stage0, feature(panic_implementation))]
#![cfg_attr(not(stage0), feature(panic_handler))]
#![feature(non_exhaustive)] #![feature(non_exhaustive)]
#![default_lib_allocator] #![default_lib_allocator]

View file

@ -487,7 +487,6 @@ declare_features! (
// RFC 2070: #[panic_implementation] / #[panic_handler] // RFC 2070: #[panic_implementation] / #[panic_handler]
(active, panic_implementation, "1.28.0", Some(44489), None), (active, panic_implementation, "1.28.0", Some(44489), None),
(active, panic_handler, "1.30.0", Some(44489), None),
// #[doc(keyword = "...")] // #[doc(keyword = "...")]
(active, doc_keyword, "1.28.0", Some(51315), None), (active, doc_keyword, "1.28.0", Some(51315), None),
@ -674,6 +673,7 @@ declare_features! (
(accepted, proc_macro_path_invoc, "1.30.0", Some(38356), None), (accepted, proc_macro_path_invoc, "1.30.0", Some(38356), None),
// Allows all literals in attribute lists and values of key-value pairs. // Allows all literals in attribute lists and values of key-value pairs.
(accepted, attr_literals, "1.30.0", Some(34981), None), (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 // If you change this, please modify src/doc/unstable-book as well. You must
@ -1143,10 +1143,7 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG
cfg_fn!(panic_implementation))), cfg_fn!(panic_implementation))),
// RFC 2070 // RFC 2070
("panic_handler", Normal, Gated(Stability::Unstable, ("panic_handler", Normal, Ungated),
"panic_handler",
"#[panic_handler] is an unstable feature",
cfg_fn!(panic_handler))),
("alloc_error_handler", Normal, Gated(Stability::Unstable, ("alloc_error_handler", Normal, Gated(Stability::Unstable,
"alloc_error_handler", "alloc_error_handler",

View file

@ -11,7 +11,6 @@
// no-prefer-dynamic // no-prefer-dynamic
#![crate_type = "rlib"] #![crate_type = "rlib"]
#![feature(panic_handler)]
#![no_std] #![no_std]
use core::panic::PanicInfo; use core::panic::PanicInfo;

View file

@ -10,7 +10,6 @@
// aux-build:some-panic-impl.rs // aux-build:some-panic-impl.rs
#![feature(panic_handler)]
#![feature(lang_items)] #![feature(lang_items)]
#![no_std] #![no_std]
#![no_main] #![no_main]

View file

@ -10,7 +10,6 @@
#![crate_type = "bin"] #![crate_type = "bin"]
#![feature(lang_items)] #![feature(lang_items)]
#![feature(panic_handler)]
#![no_main] #![no_main]
#![no_std] #![no_std]

View file

@ -9,7 +9,6 @@
// except according to those terms. // except according to those terms.
#![crate_type = "rlib"] #![crate_type = "rlib"]
#![feature(panic_handler)]
#![no_std] #![no_std]
use core::panic::PanicInfo; use core::panic::PanicInfo;

View file

@ -10,7 +10,6 @@
#![crate_type = "bin"] #![crate_type = "bin"]
#![feature(lang_items)] #![feature(lang_items)]
#![feature(panic_handler)]
#![feature(const_panic)] #![feature(const_panic)]
#![no_main] #![no_main]
#![no_std] #![no_std]

View file

@ -1,31 +1,31 @@
error: this constant cannot be used 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"); 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: #[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) = 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 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!(); 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) = 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 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!(); 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) = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

View file

@ -1,21 +0,0 @@
// 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 {}
}

View file

@ -1,11 +0,0 @@
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`.

View file

@ -11,7 +11,6 @@
// no-prefer-dynamic // no-prefer-dynamic
#![crate_type = "rlib"] #![crate_type = "rlib"]
#![feature(panic_handler)]
#![no_std] #![no_std]
use core::panic::PanicInfo; use core::panic::PanicInfo;

View file

@ -10,7 +10,6 @@
// compile-flags:-C panic=abort // compile-flags:-C panic=abort
#![feature(panic_handler)]
#![no_std] #![no_std]
#![no_main] #![no_main]

View file

@ -1,11 +1,11 @@
error: return type should be `!` 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 `!` LL | ) -> () //~ ERROR return type should be `!`
| ^^ | ^^
error: argument should be `&PanicInfo` 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` LL | info: PanicInfo, //~ ERROR argument should be `&PanicInfo`
| ^^^^^^^^^ | ^^^^^^^^^

View file

@ -10,7 +10,6 @@
// compile-flags:-C panic=abort // compile-flags:-C panic=abort
#![feature(panic_handler)]
#![no_std] #![no_std]
#![no_main] #![no_main]

View file

@ -1,5 +1,5 @@
error: argument should be `&PanicInfo` 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` LL | info: &'static PanicInfo, //~ ERROR argument should be `&PanicInfo`
| ^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^

View file

@ -10,7 +10,6 @@
// compile-flags:-C panic=abort // compile-flags:-C panic=abort
#![feature(panic_handler)]
#![no_std] #![no_std]
#![no_main] #![no_main]

View file

@ -1,5 +1,5 @@
error: function should have one argument 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 LL | fn panic() -> ! { //~ ERROR function should have one argument
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^

View file

@ -10,7 +10,6 @@
// compile-flags:-C panic=abort // compile-flags:-C panic=abort
#![feature(panic_handler)]
#![no_std] #![no_std]
#![no_main] #![no_main]

View file

@ -1,5 +1,5 @@
error: should have no type parameters 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 | / fn panic<T>(pi: &PanicInfo) -> ! {
LL | | //~^ ERROR should have no type parameters LL | | //~^ ERROR should have no type parameters

View file

@ -11,7 +11,6 @@
// compile-flags:-C panic=abort // compile-flags:-C panic=abort
#![feature(lang_items)] #![feature(lang_items)]
#![feature(panic_handler)]
#![no_std] #![no_std]
#![no_main] #![no_main]

View file

@ -1,5 +1,5 @@
error[E0152]: duplicate lang item found: `panic_impl`. 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 | / fn panic2(info: &PanicInfo) -> ! { //~ ERROR duplicate lang item found: `panic_impl`.
LL | | loop {} LL | | loop {}
@ -7,7 +7,7 @@ LL | | }
| |_^ | |_^
| |
note: first defined here. note: first defined here.
--> $DIR/panic-handler-duplicate.rs:21:1 --> $DIR/panic-handler-duplicate.rs:20:1
| |
LL | / fn panic(info: &PanicInfo) -> ! { LL | / fn panic(info: &PanicInfo) -> ! {
LL | | loop {} LL | | loop {}

View file

@ -13,7 +13,6 @@
#![feature(lang_items)] #![feature(lang_items)]
#![feature(no_core)] #![feature(no_core)]
#![feature(panic_handler)]
#![no_core] #![no_core]
#![no_main] #![no_main]

View file

@ -10,7 +10,6 @@
// error-pattern: duplicate lang item found: `panic_impl`. // error-pattern: duplicate lang item found: `panic_impl`.
#![feature(panic_handler)]
use std::panic::PanicInfo; use std::panic::PanicInfo;

View file

@ -1,5 +1,5 @@
error[E0152]: duplicate lang item found: `panic_impl`. 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 | / fn panic(info: PanicInfo) -> ! {
LL | | loop {} LL | | loop {}
@ -9,7 +9,7 @@ LL | | }
= note: first defined in crate `std`. = note: first defined in crate `std`.
error: argument should be `&PanicInfo` error: argument should be `&PanicInfo`
--> $DIR/panic-handler-std.rs:18:16 --> $DIR/panic-handler-std.rs:17:16
| |
LL | fn panic(info: PanicInfo) -> ! { LL | fn panic(info: PanicInfo) -> ! {
| ^^^^^^^^^ | ^^^^^^^^^

View file

@ -12,7 +12,6 @@
#![crate_type = "rlib"] #![crate_type = "rlib"]
#![no_std] #![no_std]
#![feature(panic_handler)]
#[panic_handler] #[panic_handler]
pub fn panic_fmt(_: &::core::panic::PanicInfo) -> ! { pub fn panic_fmt(_: &::core::panic::PanicInfo) -> ! {