]> git.lizzy.rs Git - rust.git/commitdiff
add #[panic_handler]; deprecate #[panic_implementation]
authorJorge Aparicio <jorge@japaric.io>
Wed, 22 Aug 2018 22:40:32 +0000 (00:40 +0200)
committerJorge Aparicio <jorge@japaric.io>
Thu, 23 Aug 2018 18:58:55 +0000 (20:58 +0200)
58 files changed:
src/librustc/middle/dead.rs
src/librustc/middle/lang_items.rs
src/librustc/middle/weak_lang_items.rs
src/librustc_typeck/check/mod.rs
src/libstd/lib.rs
src/libstd/panicking.rs
src/libsyntax/feature_gate.rs
src/test/compile-fail/auxiliary/some-panic-impl.rs
src/test/compile-fail/panic-handler-missing.rs [new file with mode: 0644]
src/test/compile-fail/panic-handler-twice.rs [new file with mode: 0644]
src/test/compile-fail/panic-implementation-missing.rs [deleted file]
src/test/compile-fail/panic-implementation-twice.rs [deleted file]
src/test/compile-fail/weak-lang-item.rs
src/test/run-make-fulldeps/issue-51671/app.rs
src/test/run-make-fulldeps/panic-impl-transitive/panic-impl-provider.rs
src/test/run-make/wasm-symbols-not-exported/bar.rs
src/test/ui/alloc-error/alloc-error-handler-bad-signature-1.rs
src/test/ui/alloc-error/alloc-error-handler-bad-signature-2.rs
src/test/ui/alloc-error/alloc-error-handler-bad-signature-3.rs
src/test/ui/feature-gates/feature-gate-panic-handler.rs [new file with mode: 0644]
src/test/ui/feature-gates/feature-gate-panic-handler.stderr [new file with mode: 0644]
src/test/ui/feature-gates/feature-gate-panic-implementation.rs [deleted file]
src/test/ui/feature-gates/feature-gate-panic-implementation.stderr [deleted file]
src/test/ui/missing/missing-alloc_error_handler.rs
src/test/ui/missing/missing-allocator.rs
src/test/ui/panic-handler/auxiliary/some-panic-impl.rs [new file with mode: 0644]
src/test/ui/panic-handler/panic-handler-bad-signature-1.rs [new file with mode: 0644]
src/test/ui/panic-handler/panic-handler-bad-signature-1.stderr [new file with mode: 0644]
src/test/ui/panic-handler/panic-handler-bad-signature-2.rs [new file with mode: 0644]
src/test/ui/panic-handler/panic-handler-bad-signature-2.stderr [new file with mode: 0644]
src/test/ui/panic-handler/panic-handler-bad-signature-3.rs [new file with mode: 0644]
src/test/ui/panic-handler/panic-handler-bad-signature-3.stderr [new file with mode: 0644]
src/test/ui/panic-handler/panic-handler-bad-signature-4.rs [new file with mode: 0644]
src/test/ui/panic-handler/panic-handler-bad-signature-4.stderr [new file with mode: 0644]
src/test/ui/panic-handler/panic-handler-duplicate.rs [new file with mode: 0644]
src/test/ui/panic-handler/panic-handler-duplicate.stderr [new file with mode: 0644]
src/test/ui/panic-handler/panic-handler-requires-panic-info.rs [new file with mode: 0644]
src/test/ui/panic-handler/panic-handler-requires-panic-info.stderr [new file with mode: 0644]
src/test/ui/panic-handler/panic-handler-std.rs [new file with mode: 0644]
src/test/ui/panic-handler/panic-handler-std.stderr [new file with mode: 0644]
src/test/ui/panic-implementation/auxiliary/some-panic-impl.rs [deleted file]
src/test/ui/panic-implementation/panic-implementation-bad-signature-1.rs [deleted file]
src/test/ui/panic-implementation/panic-implementation-bad-signature-1.stderr [deleted file]
src/test/ui/panic-implementation/panic-implementation-bad-signature-2.rs [deleted file]
src/test/ui/panic-implementation/panic-implementation-bad-signature-2.stderr [deleted file]
src/test/ui/panic-implementation/panic-implementation-bad-signature-3.rs [deleted file]
src/test/ui/panic-implementation/panic-implementation-bad-signature-3.stderr [deleted file]
src/test/ui/panic-implementation/panic-implementation-bad-signature-4.rs [deleted file]
src/test/ui/panic-implementation/panic-implementation-bad-signature-4.stderr [deleted file]
src/test/ui/panic-implementation/panic-implementation-deprecated.rs [new file with mode: 0644]
src/test/ui/panic-implementation/panic-implementation-deprecated.stderr [new file with mode: 0644]
src/test/ui/panic-implementation/panic-implementation-duplicate.rs [deleted file]
src/test/ui/panic-implementation/panic-implementation-duplicate.stderr [deleted file]
src/test/ui/panic-implementation/panic-implementation-requires-panic-info.rs [deleted file]
src/test/ui/panic-implementation/panic-implementation-requires-panic-info.stderr [deleted file]
src/test/ui/panic-implementation/panic-implementation-std.rs [deleted file]
src/test/ui/panic-implementation/panic-implementation-std.stderr [deleted file]
src/test/ui/panic_implementation-closures.rs

index ba04842ac7c0a1bcda1021f2682ca354eadbbceb..30701654f299de3e1a5419070a6071c7edeea3d5 100644 (file)
@@ -293,7 +293,9 @@ fn has_allow_dead_code_or_lang_attr(tcx: TyCtxt,
     }
 
     // (To be) stable attribute for #[lang = "panic_impl"]
-    if attr::contains_name(attrs, "panic_implementation") {
+    if attr::contains_name(attrs, "panic_implementation") ||
+        attr::contains_name(attrs, "panic_handler")
+    {
         return true;
     }
 
index 8c300a0aba0ecc5cf57fb21946e3da9b5f0ba63b..d92f856fa4dbff90445e78b1276bd011d5255b9b 100644 (file)
@@ -185,7 +185,9 @@ pub fn extract(attrs: &[ast::Attribute]) -> Option<(Symbol, Span)> {
             if let Some(value) = attribute.value_str() {
                 return Some((value, attribute.span));
             }
-        } else if attribute.check_name("panic_implementation") {
+        } else if attribute.check_name("panic_implementation") ||
+            attribute.check_name("panic_handler")
+        {
             return Some((Symbol::intern("panic_impl"), attribute.span))
         } else if attribute.check_name("alloc_error_handler") {
             return Some((Symbol::intern("oom"), attribute.span))
index e8431ce3e109b4d9505fd0d96acd225d0c29fb2b..bfc27e3b5806c95f31d34e28033065f724cedd5f 100644 (file)
@@ -113,7 +113,7 @@ fn verify<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
            !whitelisted(tcx, lang_items::$item) &&
            items.$name().is_none() {
             if lang_items::$item == lang_items::PanicImplLangItem {
-                tcx.sess.err(&format!("`#[panic_implementation]` function required, \
+                tcx.sess.err(&format!("`#[panic_handler]` function required, \
                                         but not found"));
             } else if lang_items::$item == lang_items::OomLangItem {
                 tcx.sess.err(&format!("`#[alloc_error_handler]` function required, \
index db4dda0da5b4e88100b3a2f8e2955de6aee7bfaa..4fe0212ce366b40d03b639924040be7fb0575f05 100644 (file)
@@ -1171,8 +1171,7 @@ fn check_fn<'a, 'gcx, 'tcx>(inherited: &'a Inherited<'a, 'gcx, 'tcx>,
                             if !generics.params.is_empty() {
                                 fcx.tcx.sess.span_err(
                                     span,
-                                    "`#[panic_implementation]` function should have no type \
-                                     parameters",
+                                    "should have no type parameters",
                                 );
                             }
                         }
index ade297219d221e73867a081517beff74175fafd6..b20c51d823e9a14ab1d6e02a23d12e2e77f97b9b 100644 (file)
 #![feature(doc_alias)]
 #![feature(doc_keyword)]
 #![feature(panic_info_message)]
-#![feature(panic_implementation)]
+#![cfg_attr(stage0, feature(panic_implementation))]
+#![cfg_attr(not(stage0), feature(panic_handler))]
 #![feature(non_exhaustive)]
 
 #![default_lib_allocator]
index 862f0fd71b0a3d18056eec43111ef88476d53973..6eb2db8e63bfed7567ad11a842c4d13fde6292fa 100644 (file)
@@ -319,7 +319,8 @@ pub fn panicking() -> bool {
 
 /// Entry point of panic from the libcore crate.
 #[cfg(not(test))]
-#[panic_implementation]
+#[cfg_attr(stage0, panic_implementation)]
+#[cfg_attr(not(stage0), panic_handler)]
 #[unwind(allowed)]
 pub fn rust_begin_panic(info: &PanicInfo) -> ! {
     continue_panic_fmt(&info)
index 1ffb6e55f06e3f249c36d9c187ac60a324be9487..04066f687fc7b222c6eaa2d6b849c650bd4f20d4 100644 (file)
@@ -472,8 +472,9 @@ pub fn walk_feature_fields<F>(&self, mut f: F)
     // Integer match exhaustiveness checking
     (active, exhaustive_integer_patterns, "1.30.0", Some(50907), None),
 
-    // #[panic_implementation]
+    // 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),
@@ -1104,11 +1105,18 @@ pub fn is_builtin_attr(attr: &ast::Attribute) -> bool {
                                    "infer 'static lifetime requirements",
                                    cfg_fn!(infer_static_outlives_requirements))),
 
+    // RFC 2070 (deprecated attribute name)
+    ("panic_implementation",
+     Normal, Gated(Stability::Deprecated("https://github.com/rust-lang/rust/issues/44489#issuecomment-415140224"),
+                   "panic_implementation",
+                   "This attribute was renamed to `panic_handler`",
+                   cfg_fn!(panic_implementation))),
+
     // RFC 2070
-    ("panic_implementation", Normal, Gated(Stability::Unstable,
-                           "panic_implementation",
-                           "#[panic_implementation] is an unstable feature",
-                           cfg_fn!(panic_implementation))),
+    ("panic_handler", Normal, Gated(Stability::Unstable,
+                                    "panic_handler",
+                                    "#[panic_handler] is an unstable feature",
+                                    cfg_fn!(panic_handler))),
 
     ("alloc_error_handler", Normal, Gated(Stability::Unstable,
                            "alloc_error_handler",
index db16ac325ac595c8d93335623d8e90c67a3859b8..e3b4fba176e3c2be517e4ac7672dbf62a7f36df1 100644 (file)
 // no-prefer-dynamic
 
 #![crate_type = "rlib"]
-#![feature(panic_implementation)]
+#![feature(panic_handler)]
 #![no_std]
 
 use core::panic::PanicInfo;
 
-#[panic_implementation]
+#[panic_handler]
 fn panic(info: &PanicInfo) -> ! {
     loop {}
 }
diff --git a/src/test/compile-fail/panic-handler-missing.rs b/src/test/compile-fail/panic-handler-missing.rs
new file mode 100644 (file)
index 0000000..d17c19b
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.
+
+// error-pattern: `#[panic_handler]` function required, but not found
+
+#![feature(lang_items)]
+#![no_main]
+#![no_std]
+
+#[lang = "eh_personality"]
+fn eh() {}
diff --git a/src/test/compile-fail/panic-handler-twice.rs b/src/test/compile-fail/panic-handler-twice.rs
new file mode 100644 (file)
index 0000000..6c9515c
--- /dev/null
@@ -0,0 +1,29 @@
+// 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.
+
+// aux-build:some-panic-impl.rs
+
+#![feature(panic_handler)]
+#![feature(lang_items)]
+#![no_std]
+#![no_main]
+
+extern crate some_panic_impl;
+
+use core::panic::PanicInfo;
+
+#[panic_handler]
+fn panic(info: &PanicInfo) -> ! {
+    //~^ error duplicate lang item found: `panic_impl`
+    loop {}
+}
+
+#[lang = "eh_personality"]
+fn eh() {}
diff --git a/src/test/compile-fail/panic-implementation-missing.rs b/src/test/compile-fail/panic-implementation-missing.rs
deleted file mode 100644 (file)
index b11081a..0000000
+++ /dev/null
@@ -1,18 +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.
-
-// error-pattern: `#[panic_implementation]` function required, but not found
-
-#![feature(lang_items)]
-#![no_main]
-#![no_std]
-
-#[lang = "eh_personality"]
-fn eh() {}
diff --git a/src/test/compile-fail/panic-implementation-twice.rs b/src/test/compile-fail/panic-implementation-twice.rs
deleted file mode 100644 (file)
index 78dc545..0000000
+++ /dev/null
@@ -1,29 +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.
-
-// aux-build:some-panic-impl.rs
-
-#![feature(panic_implementation)]
-#![feature(lang_items)]
-#![no_std]
-#![no_main]
-
-extern crate some_panic_impl;
-
-use core::panic::PanicInfo;
-
-#[panic_implementation]
-fn panic(info: &PanicInfo) -> ! {
-    //~^ error duplicate lang item found: `panic_impl`
-    loop {}
-}
-
-#[lang = "eh_personality"]
-fn eh() {}
index 42972c40674b68e31e67d93f9fa24c83f59e6ad1..493c708018177e7f9ffb4dfe88f6d04e49eb42a1 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 // aux-build:weak-lang-items.rs
-// error-pattern: `#[panic_implementation]` function required, but not found
+// error-pattern: `#[panic_handler]` function required, but not found
 // error-pattern: language item required, but not found: `eh_personality`
 // ignore-wasm32-bare compiled with panic=abort, personality not required
 
index 453602b800b5e546d7cecb9d7e4069885a04a8dd..e980b12039e96d35ba674b0a437b8469570b37b6 100644 (file)
 
 #![crate_type = "bin"]
 #![feature(lang_items)]
-#![feature(panic_implementation)]
+#![feature(panic_handler)]
 #![no_main]
 #![no_std]
 
 use core::alloc::Layout;
 use core::panic::PanicInfo;
 
-#[panic_implementation]
+#[panic_handler]
 fn panic(_: &PanicInfo) -> ! {
     loop {}
 }
index 46cdf2e2fa55e5397fb4d60ccdc436acebbbec8d..065b2b6bf18faf70de11bf0123470bc092718492 100644 (file)
@@ -9,12 +9,12 @@
 // except according to those terms.
 
 #![crate_type = "rlib"]
-#![feature(panic_implementation)]
+#![feature(panic_handler)]
 #![no_std]
 
 use core::panic::PanicInfo;
 
-#[panic_implementation]
+#[panic_handler]
 fn panic(info: &PanicInfo) -> ! {
     loop {}
 }
index 979ec44b040776407dd955a1b5a5cf4ade1e057c..061280779b0cf633fc2584527bc8a496033aaec7 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(panic_implementation, alloc_error_handler)]
+#![feature(panic_handler, alloc_error_handler)]
 #![crate_type = "cdylib"]
 #![no_std]
 
@@ -39,7 +39,7 @@ fn a(_: core::alloc::Layout) -> ! {
     loop {}
 }
 
-#[panic_implementation]
+#[panic_handler]
 fn b(_: &core::panic::PanicInfo) -> ! {
     loop {}
 }
index e398f16a065bd186c4b46a2ac3c5777d14e05114..0a54ae8341bbf70440c17b90400337e91935e465 100644 (file)
@@ -10,7 +10,7 @@
 
 // compile-flags:-C panic=abort
 
-#![feature(alloc_error_handler, panic_implementation)]
+#![feature(alloc_error_handler, panic_handler)]
 #![no_std]
 #![no_main]
 
@@ -24,5 +24,5 @@ fn oom(
     loop {}
 }
 
-#[panic_implementation]
+#[panic_handler]
 fn panic(_: &core::panic::PanicInfo) -> ! { loop {} }
index 4fee9d27e51759275aea4dcbdd5cd77216413fae..b33d82cd55008ede367ce912ef4ceb7e1dc17d50 100644 (file)
@@ -10,7 +10,7 @@
 
 // compile-flags:-C panic=abort
 
-#![feature(alloc_error_handler, panic_implementation)]
+#![feature(alloc_error_handler, panic_handler)]
 #![no_std]
 #![no_main]
 
@@ -23,5 +23,5 @@ fn oom(
     loop {}
 }
 
-#[panic_implementation]
+#[panic_handler]
 fn panic(_: &core::panic::PanicInfo) -> ! { loop {} }
index 828a78055d5f2ca21edae22a5db2c7d1117d0bc0..0e102dd08ea5de6212be85f8ea879e31fcebc444 100644 (file)
@@ -10,7 +10,7 @@
 
 // compile-flags:-C panic=abort
 
-#![feature(alloc_error_handler, panic_implementation)]
+#![feature(alloc_error_handler, panic_handler)]
 #![no_std]
 #![no_main]
 
@@ -21,5 +21,5 @@ fn oom() -> ! { //~ ERROR function should have one argument
     loop {}
 }
 
-#[panic_implementation]
+#[panic_handler]
 fn panic(_: &core::panic::PanicInfo) -> ! { loop {} }
diff --git a/src/test/ui/feature-gates/feature-gate-panic-handler.rs b/src/test/ui/feature-gates/feature-gate-panic-handler.rs
new file mode 100644 (file)
index 0000000..fd16268
--- /dev/null
@@ -0,0 +1,21 @@
+// 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
new file mode 100644 (file)
index 0000000..9680a24
--- /dev/null
@@ -0,0 +1,11 @@
+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`.
diff --git a/src/test/ui/feature-gates/feature-gate-panic-implementation.rs b/src/test/ui/feature-gates/feature-gate-panic-implementation.rs
deleted file mode 100644 (file)
index ae9fbc7..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_implementation] //~ ERROR #[panic_implementation] is an unstable feature (see issue #44489)
-fn panic(info: &PanicInfo) -> ! {
-    loop {}
-}
diff --git a/src/test/ui/feature-gates/feature-gate-panic-implementation.stderr b/src/test/ui/feature-gates/feature-gate-panic-implementation.stderr
deleted file mode 100644 (file)
index f99228b..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0658]: #[panic_implementation] is an unstable feature (see issue #44489)
-  --> $DIR/feature-gate-panic-implementation.rs:18:1
-   |
-LL | #[panic_implementation] //~ ERROR #[panic_implementation] is an unstable feature (see issue #44489)
-   | ^^^^^^^^^^^^^^^^^^^^^^^
-   |
-   = help: add #![feature(panic_implementation)] to the crate attributes to enable
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0658`.
index 3842d48f8fab110a759979429c8963adbf8e3435..1096027c8dc0becb64d663398e9773072a9edfa6 100644 (file)
@@ -13,9 +13,9 @@
 
 #![no_std]
 #![crate_type = "staticlib"]
-#![feature(panic_implementation, alloc_error_handler, alloc)]
+#![feature(panic_handler, alloc_error_handler, alloc)]
 
-#[panic_implementation]
+#[panic_handler]
 fn panic(_: &core::panic::PanicInfo) -> ! {
     loop {}
 }
index c949dcb635aad5ccbc0bf998cb06531515e109b1..f4331c4b99480cc2f2dd5b38afe0106c1e83513e 100644 (file)
@@ -13,9 +13,9 @@
 
 #![no_std]
 #![crate_type = "staticlib"]
-#![feature(panic_implementation, alloc_error_handler, alloc)]
+#![feature(panic_handler, alloc_error_handler, alloc)]
 
-#[panic_implementation]
+#[panic_handler]
 fn panic(_: &core::panic::PanicInfo) -> ! {
     loop {}
 }
diff --git a/src/test/ui/panic-handler/auxiliary/some-panic-impl.rs b/src/test/ui/panic-handler/auxiliary/some-panic-impl.rs
new file mode 100644 (file)
index 0000000..e3b4fba
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+// no-prefer-dynamic
+
+#![crate_type = "rlib"]
+#![feature(panic_handler)]
+#![no_std]
+
+use core::panic::PanicInfo;
+
+#[panic_handler]
+fn panic(info: &PanicInfo) -> ! {
+    loop {}
+}
diff --git a/src/test/ui/panic-handler/panic-handler-bad-signature-1.rs b/src/test/ui/panic-handler/panic-handler-bad-signature-1.rs
new file mode 100644 (file)
index 0000000..cc7e337
--- /dev/null
@@ -0,0 +1,24 @@
+// 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
+
+#![feature(panic_handler)]
+#![no_std]
+#![no_main]
+
+use core::panic::PanicInfo;
+
+#[panic_handler]
+fn panic(
+    info: PanicInfo, //~ ERROR argument should be `&PanicInfo`
+) -> () //~ ERROR return type should be `!`
+{
+}
diff --git a/src/test/ui/panic-handler/panic-handler-bad-signature-1.stderr b/src/test/ui/panic-handler/panic-handler-bad-signature-1.stderr
new file mode 100644 (file)
index 0000000..5771f42
--- /dev/null
@@ -0,0 +1,14 @@
+error: return type should be `!`
+  --> $DIR/panic-handler-bad-signature-1.rs:22:6
+   |
+LL | ) -> () //~ ERROR return type should be `!`
+   |      ^^
+
+error: argument should be `&PanicInfo`
+  --> $DIR/panic-handler-bad-signature-1.rs:21:11
+   |
+LL |     info: PanicInfo, //~ ERROR argument should be `&PanicInfo`
+   |           ^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/panic-handler/panic-handler-bad-signature-2.rs b/src/test/ui/panic-handler/panic-handler-bad-signature-2.rs
new file mode 100644 (file)
index 0000000..ec69890
--- /dev/null
@@ -0,0 +1,25 @@
+// 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
+
+#![feature(panic_handler)]
+#![no_std]
+#![no_main]
+
+use core::panic::PanicInfo;
+
+#[panic_handler]
+fn panic(
+    info: &'static PanicInfo, //~ ERROR argument should be `&PanicInfo`
+) -> !
+{
+    loop {}
+}
diff --git a/src/test/ui/panic-handler/panic-handler-bad-signature-2.stderr b/src/test/ui/panic-handler/panic-handler-bad-signature-2.stderr
new file mode 100644 (file)
index 0000000..4823f8a
--- /dev/null
@@ -0,0 +1,8 @@
+error: argument should be `&PanicInfo`
+  --> $DIR/panic-handler-bad-signature-2.rs:21:11
+   |
+LL |     info: &'static PanicInfo, //~ ERROR argument should be `&PanicInfo`
+   |           ^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/panic-handler/panic-handler-bad-signature-3.rs b/src/test/ui/panic-handler/panic-handler-bad-signature-3.rs
new file mode 100644 (file)
index 0000000..585716c
--- /dev/null
@@ -0,0 +1,22 @@
+// 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
+
+#![feature(panic_handler)]
+#![no_std]
+#![no_main]
+
+use core::panic::PanicInfo;
+
+#[panic_handler]
+fn panic() -> ! { //~ ERROR function should have one argument
+    loop {}
+}
diff --git a/src/test/ui/panic-handler/panic-handler-bad-signature-3.stderr b/src/test/ui/panic-handler/panic-handler-bad-signature-3.stderr
new file mode 100644 (file)
index 0000000..0eb0d4e
--- /dev/null
@@ -0,0 +1,10 @@
+error: function should have one argument
+  --> $DIR/panic-handler-bad-signature-3.rs:20:1
+   |
+LL | / fn panic() -> ! { //~ ERROR function should have one argument
+LL | |     loop {}
+LL | | }
+   | |_^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/panic-handler/panic-handler-bad-signature-4.rs b/src/test/ui/panic-handler/panic-handler-bad-signature-4.rs
new file mode 100644 (file)
index 0000000..9cda37f
--- /dev/null
@@ -0,0 +1,23 @@
+// 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
+
+#![feature(panic_handler)]
+#![no_std]
+#![no_main]
+
+use core::panic::PanicInfo;
+
+#[panic_handler]
+fn panic<T>(pi: &PanicInfo) -> ! {
+    //~^ ERROR should have no type parameters
+    loop {}
+}
diff --git a/src/test/ui/panic-handler/panic-handler-bad-signature-4.stderr b/src/test/ui/panic-handler/panic-handler-bad-signature-4.stderr
new file mode 100644 (file)
index 0000000..a61b9b3
--- /dev/null
@@ -0,0 +1,11 @@
+error: should have no type parameters
+  --> $DIR/panic-handler-bad-signature-4.rs:20:1
+   |
+LL | / fn panic<T>(pi: &PanicInfo) -> ! {
+LL | |     //~^ ERROR should have no type parameters
+LL | |     loop {}
+LL | | }
+   | |_^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/panic-handler/panic-handler-duplicate.rs b/src/test/ui/panic-handler/panic-handler-duplicate.rs
new file mode 100644 (file)
index 0000000..7d7fe25
--- /dev/null
@@ -0,0 +1,28 @@
+// 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
+
+#![feature(lang_items)]
+#![feature(panic_handler)]
+#![no_std]
+#![no_main]
+
+use core::panic::PanicInfo;
+
+#[panic_handler]
+fn panic(info: &PanicInfo) -> ! {
+    loop {}
+}
+
+#[lang = "panic_impl"]
+fn panic2(info: &PanicInfo) -> ! { //~ ERROR duplicate lang item found: `panic_impl`.
+    loop {}
+}
diff --git a/src/test/ui/panic-handler/panic-handler-duplicate.stderr b/src/test/ui/panic-handler/panic-handler-duplicate.stderr
new file mode 100644 (file)
index 0000000..d8afaa2
--- /dev/null
@@ -0,0 +1,19 @@
+error[E0152]: duplicate lang item found: `panic_impl`.
+  --> $DIR/panic-handler-duplicate.rs:26:1
+   |
+LL | / fn panic2(info: &PanicInfo) -> ! { //~ ERROR duplicate lang item found: `panic_impl`.
+LL | |     loop {}
+LL | | }
+   | |_^
+   |
+note: first defined here.
+  --> $DIR/panic-handler-duplicate.rs:21:1
+   |
+LL | / fn panic(info: &PanicInfo) -> ! {
+LL | |     loop {}
+LL | | }
+   | |_^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0152`.
diff --git a/src/test/ui/panic-handler/panic-handler-requires-panic-info.rs b/src/test/ui/panic-handler/panic-handler-requires-panic-info.rs
new file mode 100644 (file)
index 0000000..ec68a41
--- /dev/null
@@ -0,0 +1,26 @@
+// 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
+// error-pattern: language item required, but not found: `panic_info`
+
+#![feature(lang_items)]
+#![feature(no_core)]
+#![feature(panic_handler)]
+#![no_core]
+#![no_main]
+
+#[panic_handler]
+fn panic() -> ! {
+    loop {}
+}
+
+#[lang = "sized"]
+trait Sized {}
diff --git a/src/test/ui/panic-handler/panic-handler-requires-panic-info.stderr b/src/test/ui/panic-handler/panic-handler-requires-panic-info.stderr
new file mode 100644 (file)
index 0000000..2bae12e
--- /dev/null
@@ -0,0 +1,4 @@
+error: language item required, but not found: `panic_info`
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/panic-handler/panic-handler-std.rs b/src/test/ui/panic-handler/panic-handler-std.rs
new file mode 100644 (file)
index 0000000..7cbe0a3
--- /dev/null
@@ -0,0 +1,22 @@
+// 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.
+
+// error-pattern: duplicate lang item found: `panic_impl`.
+
+#![feature(panic_handler)]
+
+use std::panic::PanicInfo;
+
+#[panic_handler]
+fn panic(info: PanicInfo) -> ! {
+    loop {}
+}
+
+fn main() {}
diff --git a/src/test/ui/panic-handler/panic-handler-std.stderr b/src/test/ui/panic-handler/panic-handler-std.stderr
new file mode 100644 (file)
index 0000000..c34a993
--- /dev/null
@@ -0,0 +1,13 @@
+error[E0152]: duplicate lang item found: `panic_impl`.
+  --> $DIR/panic-handler-std.rs:18:1
+   |
+LL | / fn panic(info: PanicInfo) -> ! {
+LL | |     loop {}
+LL | | }
+   | |_^
+   |
+   = note: first defined in crate `std`.
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0152`.
diff --git a/src/test/ui/panic-implementation/auxiliary/some-panic-impl.rs b/src/test/ui/panic-implementation/auxiliary/some-panic-impl.rs
deleted file mode 100644 (file)
index db16ac3..0000000
+++ /dev/null
@@ -1,22 +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.
-
-// no-prefer-dynamic
-
-#![crate_type = "rlib"]
-#![feature(panic_implementation)]
-#![no_std]
-
-use core::panic::PanicInfo;
-
-#[panic_implementation]
-fn panic(info: &PanicInfo) -> ! {
-    loop {}
-}
diff --git a/src/test/ui/panic-implementation/panic-implementation-bad-signature-1.rs b/src/test/ui/panic-implementation/panic-implementation-bad-signature-1.rs
deleted file mode 100644 (file)
index fec11fd..0000000
+++ /dev/null
@@ -1,24 +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
-
-#![feature(panic_implementation)]
-#![no_std]
-#![no_main]
-
-use core::panic::PanicInfo;
-
-#[panic_implementation]
-fn panic(
-    info: PanicInfo, //~ ERROR argument should be `&PanicInfo`
-) -> () //~ ERROR return type should be `!`
-{
-}
diff --git a/src/test/ui/panic-implementation/panic-implementation-bad-signature-1.stderr b/src/test/ui/panic-implementation/panic-implementation-bad-signature-1.stderr
deleted file mode 100644 (file)
index 0e020fb..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-error: return type should be `!`
-  --> $DIR/panic-implementation-bad-signature-1.rs:22:6
-   |
-LL | ) -> () //~ ERROR return type should be `!`
-   |      ^^
-
-error: argument should be `&PanicInfo`
-  --> $DIR/panic-implementation-bad-signature-1.rs:21:11
-   |
-LL |     info: PanicInfo, //~ ERROR argument should be `&PanicInfo`
-   |           ^^^^^^^^^
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/panic-implementation/panic-implementation-bad-signature-2.rs b/src/test/ui/panic-implementation/panic-implementation-bad-signature-2.rs
deleted file mode 100644 (file)
index 2a628c0..0000000
+++ /dev/null
@@ -1,25 +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
-
-#![feature(panic_implementation)]
-#![no_std]
-#![no_main]
-
-use core::panic::PanicInfo;
-
-#[panic_implementation]
-fn panic(
-    info: &'static PanicInfo, //~ ERROR argument should be `&PanicInfo`
-) -> !
-{
-    loop {}
-}
diff --git a/src/test/ui/panic-implementation/panic-implementation-bad-signature-2.stderr b/src/test/ui/panic-implementation/panic-implementation-bad-signature-2.stderr
deleted file mode 100644 (file)
index 71ed1ef..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-error: argument should be `&PanicInfo`
-  --> $DIR/panic-implementation-bad-signature-2.rs:21:11
-   |
-LL |     info: &'static PanicInfo, //~ ERROR argument should be `&PanicInfo`
-   |           ^^^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/panic-implementation/panic-implementation-bad-signature-3.rs b/src/test/ui/panic-implementation/panic-implementation-bad-signature-3.rs
deleted file mode 100644 (file)
index 2933702..0000000
+++ /dev/null
@@ -1,22 +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
-
-#![feature(panic_implementation)]
-#![no_std]
-#![no_main]
-
-use core::panic::PanicInfo;
-
-#[panic_implementation]
-fn panic() -> ! { //~ ERROR function should have one argument
-    loop {}
-}
diff --git a/src/test/ui/panic-implementation/panic-implementation-bad-signature-3.stderr b/src/test/ui/panic-implementation/panic-implementation-bad-signature-3.stderr
deleted file mode 100644 (file)
index 3fd29bc..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-error: function should have one argument
-  --> $DIR/panic-implementation-bad-signature-3.rs:20:1
-   |
-LL | / fn panic() -> ! { //~ ERROR function should have one argument
-LL | |     loop {}
-LL | | }
-   | |_^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/panic-implementation/panic-implementation-bad-signature-4.rs b/src/test/ui/panic-implementation/panic-implementation-bad-signature-4.rs
deleted file mode 100644 (file)
index d5f942b..0000000
+++ /dev/null
@@ -1,23 +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
-
-#![feature(panic_implementation)]
-#![no_std]
-#![no_main]
-
-use core::panic::PanicInfo;
-
-#[panic_implementation]
-fn panic<T>(pi: &PanicInfo) -> ! {
-    //~^ ERROR `#[panic_implementation]` function should have no type parameters
-    loop {}
-}
diff --git a/src/test/ui/panic-implementation/panic-implementation-bad-signature-4.stderr b/src/test/ui/panic-implementation/panic-implementation-bad-signature-4.stderr
deleted file mode 100644 (file)
index 362be2f..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-error: `#[panic_implementation]` function should have no type parameters
-  --> $DIR/panic-implementation-bad-signature-4.rs:20:1
-   |
-LL | / fn panic<T>(pi: &PanicInfo) -> ! {
-LL | |     //~^ ERROR `#[panic_implementation]` function should have no type parameters
-LL | |     loop {}
-LL | | }
-   | |_^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/panic-implementation/panic-implementation-deprecated.rs b/src/test/ui/panic-implementation/panic-implementation-deprecated.rs
new file mode 100644 (file)
index 0000000..c4bec01
--- /dev/null
@@ -0,0 +1,24 @@
+// 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
+
+#![deny(deprecated)]
+#![feature(panic_implementation)]
+#![no_std]
+
+use core::panic::PanicInfo;
+
+#[panic_implementation]
+fn panic(info: &PanicInfo) -> ! {
+    loop {}
+}
+
+fn main() {}
diff --git a/src/test/ui/panic-implementation/panic-implementation-deprecated.stderr b/src/test/ui/panic-implementation/panic-implementation-deprecated.stderr
new file mode 100644 (file)
index 0000000..43f5144
--- /dev/null
@@ -0,0 +1,14 @@
+error: use of deprecated attribute `panic_implementation`: This attribute was renamed to `panic_handler`. See https://github.com/rust-lang/rust/issues/44489#issuecomment-415140224
+  --> $DIR/panic-implementation-deprecated.rs:19:1
+   |
+LL | #[panic_implementation]
+   | ^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
+   |
+note: lint level defined here
+  --> $DIR/panic-implementation-deprecated.rs:13:9
+   |
+LL | #![deny(deprecated)]
+   |         ^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/panic-implementation/panic-implementation-duplicate.rs b/src/test/ui/panic-implementation/panic-implementation-duplicate.rs
deleted file mode 100644 (file)
index 017113a..0000000
+++ /dev/null
@@ -1,28 +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
-
-#![feature(lang_items)]
-#![feature(panic_implementation)]
-#![no_std]
-#![no_main]
-
-use core::panic::PanicInfo;
-
-#[panic_implementation]
-fn panic(info: &PanicInfo) -> ! {
-    loop {}
-}
-
-#[lang = "panic_impl"]
-fn panic2(info: &PanicInfo) -> ! { //~ ERROR duplicate lang item found: `panic_impl`.
-    loop {}
-}
diff --git a/src/test/ui/panic-implementation/panic-implementation-duplicate.stderr b/src/test/ui/panic-implementation/panic-implementation-duplicate.stderr
deleted file mode 100644 (file)
index d553c02..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0152]: duplicate lang item found: `panic_impl`.
-  --> $DIR/panic-implementation-duplicate.rs:26:1
-   |
-LL | / fn panic2(info: &PanicInfo) -> ! { //~ ERROR duplicate lang item found: `panic_impl`.
-LL | |     loop {}
-LL | | }
-   | |_^
-   |
-note: first defined here.
-  --> $DIR/panic-implementation-duplicate.rs:21:1
-   |
-LL | / fn panic(info: &PanicInfo) -> ! {
-LL | |     loop {}
-LL | | }
-   | |_^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0152`.
diff --git a/src/test/ui/panic-implementation/panic-implementation-requires-panic-info.rs b/src/test/ui/panic-implementation/panic-implementation-requires-panic-info.rs
deleted file mode 100644 (file)
index 597f44d..0000000
+++ /dev/null
@@ -1,26 +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
-// error-pattern: language item required, but not found: `panic_info`
-
-#![feature(lang_items)]
-#![feature(no_core)]
-#![feature(panic_implementation)]
-#![no_core]
-#![no_main]
-
-#[panic_implementation]
-fn panic() -> ! {
-    loop {}
-}
-
-#[lang = "sized"]
-trait Sized {}
diff --git a/src/test/ui/panic-implementation/panic-implementation-requires-panic-info.stderr b/src/test/ui/panic-implementation/panic-implementation-requires-panic-info.stderr
deleted file mode 100644 (file)
index 2bae12e..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-error: language item required, but not found: `panic_info`
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/panic-implementation/panic-implementation-std.rs b/src/test/ui/panic-implementation/panic-implementation-std.rs
deleted file mode 100644 (file)
index f25cd36..0000000
+++ /dev/null
@@ -1,22 +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.
-
-// error-pattern: duplicate lang item found: `panic_impl`.
-
-#![feature(panic_implementation)]
-
-use std::panic::PanicInfo;
-
-#[panic_implementation]
-fn panic(info: PanicInfo) -> ! {
-    loop {}
-}
-
-fn main() {}
diff --git a/src/test/ui/panic-implementation/panic-implementation-std.stderr b/src/test/ui/panic-implementation/panic-implementation-std.stderr
deleted file mode 100644 (file)
index 5016d50..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-error[E0152]: duplicate lang item found: `panic_impl`.
-  --> $DIR/panic-implementation-std.rs:18:1
-   |
-LL | / fn panic(info: PanicInfo) -> ! {
-LL | |     loop {}
-LL | | }
-   | |_^
-   |
-   = note: first defined in crate `std`.
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0152`.
index 4fa9a639928f98f41ca54f3d9ddfe19f694819fa..6642db6ee76bf25a73a8258866428d2a55735e99 100644 (file)
@@ -12,9 +12,9 @@
 
 #![crate_type = "rlib"]
 #![no_std]
-#![feature(panic_implementation)]
+#![feature(panic_handler)]
 
-#[panic_implementation]
+#[panic_handler]
 pub fn panic_fmt(_: &::core::panic::PanicInfo) -> ! {
     |x: u8| x;
     loop {}