]> git.lizzy.rs Git - rust.git/commitdiff
stabilize `#[panic_handler]`
authorJorge Aparicio <jorge@japaric.io>
Fri, 7 Sep 2018 10:43:39 +0000 (12:43 +0200)
committerJorge Aparicio <jorge@japaric.io>
Fri, 7 Sep 2018 11:27:30 +0000 (13:27 +0200)
25 files changed:
src/libstd/lib.rs
src/libsyntax/feature_gate.rs
src/test/compile-fail/auxiliary/some-panic-impl.rs
src/test/compile-fail/panic-handler-twice.rs
src/test/run-make-fulldeps/issue-51671/app.rs
src/test/run-make-fulldeps/panic-impl-transitive/panic-impl-provider.rs
src/test/ui/consts/const-eval/const_panic_libcore_main.rs
src/test/ui/consts/const-eval/const_panic_libcore_main.stderr
src/test/ui/feature-gates/feature-gate-panic-handler.rs [deleted file]
src/test/ui/feature-gates/feature-gate-panic-handler.stderr [deleted file]
src/test/ui/panic-handler/auxiliary/some-panic-impl.rs
src/test/ui/panic-handler/panic-handler-bad-signature-1.rs
src/test/ui/panic-handler/panic-handler-bad-signature-1.stderr
src/test/ui/panic-handler/panic-handler-bad-signature-2.rs
src/test/ui/panic-handler/panic-handler-bad-signature-2.stderr
src/test/ui/panic-handler/panic-handler-bad-signature-3.rs
src/test/ui/panic-handler/panic-handler-bad-signature-3.stderr
src/test/ui/panic-handler/panic-handler-bad-signature-4.rs
src/test/ui/panic-handler/panic-handler-bad-signature-4.stderr
src/test/ui/panic-handler/panic-handler-duplicate.rs
src/test/ui/panic-handler/panic-handler-duplicate.stderr
src/test/ui/panic-handler/panic-handler-requires-panic-info.rs
src/test/ui/panic-handler/panic-handler-std.rs
src/test/ui/panic-handler/panic-handler-std.stderr
src/test/ui/panic_implementation-closures.rs

index e7195b3e21ee37c4ca3c60db1574bbd9be82ff57..4278926b042f357049fea1c9564f43820fe219b7 100644 (file)
 #![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]
index e3ea3563d853bb6fc6e2b9bc85f1b56fdddaf852..0270e36db11771814a8fd35f39e8e07e288698f9 100644 (file)
@@ -487,7 +487,6 @@ pub fn walk_feature_fields<F>(&self, mut f: F)
 
     // 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),
@@ -674,6 +673,7 @@ pub fn walk_feature_fields<F>(&self, mut f: F)
     (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
@@ -1143,10 +1143,7 @@ pub fn is_builtin_attr(attr: &ast::Attribute) -> bool {
            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",
index e3b4fba176e3c2be517e4ac7672dbf62a7f36df1..090123198d175312f60d927fd6122c1645386e52 100644 (file)
@@ -11,7 +11,6 @@
 // no-prefer-dynamic
 
 #![crate_type = "rlib"]
-#![feature(panic_handler)]
 #![no_std]
 
 use core::panic::PanicInfo;
index 6c9515ca909942bc602b6d15fcd5d03392bfbed9..10e0453cf5ed44dcb18ebfa9ea0c8c88bd393efd 100644 (file)
@@ -10,7 +10,6 @@
 
 // aux-build:some-panic-impl.rs
 
-#![feature(panic_handler)]
 #![feature(lang_items)]
 #![no_std]
 #![no_main]
index e980b12039e96d35ba674b0a437b8469570b37b6..4066214f4b47e8643b96db7a516c88fce645ffb0 100644 (file)
@@ -10,7 +10,6 @@
 
 #![crate_type = "bin"]
 #![feature(lang_items)]
-#![feature(panic_handler)]
 #![no_main]
 #![no_std]
 
index 065b2b6bf18faf70de11bf0123470bc092718492..77aae7ee2c06b52378b22dd18b518c3642822642 100644 (file)
@@ -9,7 +9,6 @@
 // except according to those terms.
 
 #![crate_type = "rlib"]
-#![feature(panic_handler)]
 #![no_std]
 
 use core::panic::PanicInfo;
index f5e5f9778faed70a352dde4485eae5666423dfa4..0364123994dff31e57ada3ba723a1a1e4f013a6f 100644 (file)
@@ -10,7 +10,6 @@
 
 #![crate_type = "bin"]
 #![feature(lang_items)]
-#![feature(panic_handler)]
 #![feature(const_panic)]
 #![no_main]
 #![no_std]
index 7cb9f51c427a74e9d20e6aa62487672a0f0d1ada..44b30c08cdea238517456acafdd0800eae94cc97 100644 (file)
@@ -1,31 +1,31 @@
 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)
 
diff --git a/src/test/ui/feature-gates/feature-gate-panic-handler.rs b/src/test/ui/feature-gates/feature-gate-panic-handler.rs
deleted file mode 100644 (file)
index fd16268..0000000
+++ /dev/null
@@ -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 {}
-}
diff --git a/src/test/ui/feature-gates/feature-gate-panic-handler.stderr b/src/test/ui/feature-gates/feature-gate-panic-handler.stderr
deleted file mode 100644 (file)
index 9680a24..0000000
+++ /dev/null
@@ -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`.
index e3b4fba176e3c2be517e4ac7672dbf62a7f36df1..090123198d175312f60d927fd6122c1645386e52 100644 (file)
@@ -11,7 +11,6 @@
 // no-prefer-dynamic
 
 #![crate_type = "rlib"]
-#![feature(panic_handler)]
 #![no_std]
 
 use core::panic::PanicInfo;
index cc7e337fc9e657a7b9599643396445c0a2a47d51..8d53c66adbd93ba0392658aeb6d8ee35b3c9a615 100644 (file)
@@ -10,7 +10,6 @@
 
 // compile-flags:-C panic=abort
 
-#![feature(panic_handler)]
 #![no_std]
 #![no_main]
 
index 5771f4277b46d895d627341b59bed5d7000c1fb2..72b85da028f1f0f11d1dab152636e182401d2f80 100644 (file)
@@ -1,11 +1,11 @@
 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`
    |           ^^^^^^^^^
index ec698903c846e517dfb6463bac2e73f7a9c9fefb..0e8b3d5e855cb68330763df605329ae6c2334ce8 100644 (file)
@@ -10,7 +10,6 @@
 
 // compile-flags:-C panic=abort
 
-#![feature(panic_handler)]
 #![no_std]
 #![no_main]
 
index 4823f8a2781b004bfd8267f94af2700527511d75..f2bcb6b6809526fb5b7e3f7113fe8fc26a6cc096 100644 (file)
@@ -1,5 +1,5 @@
 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`
    |           ^^^^^^^^^^^^^^^^^^
index 585716c7c756906400e0922c6a303a92053df06c..ac1b19105b62ea8a31517260ccc848fc0d1526d2 100644 (file)
@@ -10,7 +10,6 @@
 
 // compile-flags:-C panic=abort
 
-#![feature(panic_handler)]
 #![no_std]
 #![no_main]
 
index 5d0395e17f54df32c2c77ed628d1a5eb6c324496..77227e0d5a61c80200bb7e134459f3b9c5ee522a 100644 (file)
@@ -1,5 +1,5 @@
 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
    | ^^^^^^^^^^^^^^^
index 9cda37f27b332ffea2f09a17b8a0ee488670b5f2..f4728408a1afae21a6d39ea58678dc31ca285677 100644 (file)
@@ -10,7 +10,6 @@
 
 // compile-flags:-C panic=abort
 
-#![feature(panic_handler)]
 #![no_std]
 #![no_main]
 
index a61b9b3743c7da9a1cbd6708e0c3dfe684d4dab5..0dd47cafd75530cec47990825c02fb686037621b 100644 (file)
@@ -1,5 +1,5 @@
 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
index 7d7fe251869f19aff992868917b09f8d028ac375..c4fb4903e00319782ed1d7748802a621126045e0 100644 (file)
@@ -11,7 +11,6 @@
 // compile-flags:-C panic=abort
 
 #![feature(lang_items)]
-#![feature(panic_handler)]
 #![no_std]
 #![no_main]
 
index d8afaa27e26624330f76884c1a00d2515d1e7e53..e243d9079d851b897d19ca6a32cc9055d0d8bcab 100644 (file)
@@ -1,5 +1,5 @@
 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 {}
@@ -7,7 +7,7 @@ LL | | }
    | |_^
    |
 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 {}
index ec68a414f54d5605433b568e66fba51352c8d911..133d6c0557ab6d033e77c8b60e1d4f976d608be6 100644 (file)
@@ -13,7 +13,6 @@
 
 #![feature(lang_items)]
 #![feature(no_core)]
-#![feature(panic_handler)]
 #![no_core]
 #![no_main]
 
index 7cbe0a35baed87eda155e2780b27090385be1172..ff5995237cf2195f274e2b4b67659f98ecf55db3 100644 (file)
@@ -10,7 +10,6 @@
 
 // error-pattern: duplicate lang item found: `panic_impl`.
 
-#![feature(panic_handler)]
 
 use std::panic::PanicInfo;
 
index b141a2171646c82306e3c15002cf2f52b842226d..4ec1c6df35522b39c5cd4d28eb79e655d2b56abe 100644 (file)
@@ -1,5 +1,5 @@
 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 {}
@@ -9,7 +9,7 @@ LL | | }
    = 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) -> ! {
    |                ^^^^^^^^^
index 6642db6ee76bf25a73a8258866428d2a55735e99..5902a1ae1b023f201a4a411b061f5b354b388f53 100644 (file)
@@ -12,7 +12,6 @@
 
 #![crate_type = "rlib"]
 #![no_std]
-#![feature(panic_handler)]
 
 #[panic_handler]
 pub fn panic_fmt(_: &::core::panic::PanicInfo) -> ! {