about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJorge Aparicio <jorge@japaric.io>2018-08-23 13:52:43 +0200
committerJorge Aparicio <jorge@japaric.io>2018-08-23 20:58:55 +0200
commitca03f86aadbcd79129fce8d29bf7dff68c778a81 (patch)
tree2908e1f84fb4f1c71e334952262555b79ce2454f /src
parenta774c81f9855f75a1a86f71a851b373d2178d9e9 (diff)
downloadrust-ca03f86aadbcd79129fce8d29bf7dff68c778a81.tar.gz
rust-ca03f86aadbcd79129fce8d29bf7dff68c778a81.zip
fix tidy
Diffstat (limited to 'src')
-rw-r--r--src/libsyntax/feature_gate.rs10
-rw-r--r--src/test/ui/feature-gates/feature-gate-panic-implementation.rs21
-rw-r--r--src/test/ui/feature-gates/feature-gate-panic-implementation.stderr11
3 files changed, 38 insertions, 4 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs
index 04066f687fc..db4bd29c4b7 100644
--- a/src/libsyntax/feature_gate.rs
+++ b/src/libsyntax/feature_gate.rs
@@ -1107,10 +1107,12 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG
 
     // 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))),
+     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_handler", Normal, Gated(Stability::Unstable,
diff --git a/src/test/ui/feature-gates/feature-gate-panic-implementation.rs b/src/test/ui/feature-gates/feature-gate-panic-implementation.rs
new file mode 100644
index 00000000000..84e5f302c16
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-panic-implementation.rs
@@ -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_implementation] //~ ERROR This attribute was renamed to `panic_handler` (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
new file mode 100644
index 00000000000..926a49ae831
--- /dev/null
+++ b/src/test/ui/feature-gates/feature-gate-panic-implementation.stderr
@@ -0,0 +1,11 @@
+error[E0658]: This attribute was renamed to `panic_handler` (see issue #44489)
+  --> $DIR/feature-gate-panic-implementation.rs:18:1
+   |
+LL | #[panic_implementation] //~ ERROR This attribute was renamed to `panic_handler` (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`.