diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 04066f687fc7..db4bd29c4b72 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 000000000000..84e5f302c167 --- /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 or the MIT license +// , 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 000000000000..926a49ae8319 --- /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`.