Skip to content

Commit 29d2cea

Browse files
committed
Remove deprecated unstable #[panic_implementation]
It was superseded by `#[panic_handler]`
1 parent 89cf577 commit 29d2cea

File tree

10 files changed

+8
-95
lines changed

10 files changed

+8
-95
lines changed

src/librustc/middle/dead.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,8 @@ fn has_allow_dead_code_or_lang_attr(tcx: TyCtxt<'_, '_, '_>,
291291
return true;
292292
}
293293

294-
// (To be) stable attribute for #[lang = "panic_impl"]
295-
if attr::contains_name(attrs, "panic_implementation") ||
296-
attr::contains_name(attrs, "panic_handler")
297-
{
294+
// Stable attribute for #[lang = "panic_impl"]
295+
if attr::contains_name(attrs, "panic_handler") {
298296
return true;
299297
}
300298

src/librustc/middle/lang_items.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,7 @@ pub fn extract(attrs: &[ast::Attribute]) -> Option<(Symbol, Span)> {
204204
if let Some(value) = attribute.value_str() {
205205
return Some((value, attribute.span));
206206
}
207-
} else if attribute.check_name("panic_implementation") ||
208-
attribute.check_name("panic_handler")
209-
{
207+
} else if attribute.check_name("panic_handler") {
210208
return Some((Symbol::intern("panic_impl"), attribute.span))
211209
} else if attribute.check_name("alloc_error_handler") {
212210
return Some((Symbol::intern("oom"), attribute.span))

src/librustc_mir/monomorphize/partitioning.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ fn mono_item_visibility(
505505
//
506506
// * First is weak lang items. These are basically mechanisms for
507507
// libcore to forward-reference symbols defined later in crates like
508-
// the standard library or `#[panic_implementation]` definitions. The
508+
// the standard library or `#[panic_handler]` definitions. The
509509
// definition of these weak lang items needs to be referenceable by
510510
// libcore, so we're no longer a candidate for internalization.
511511
// Removal of these functions can't be done by LLVM but rather must be

src/librustc_typeck/check/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1167,7 +1167,7 @@ fn check_fn<'a, 'gcx, 'tcx>(inherited: &'a Inherited<'a, 'gcx, 'tcx>,
11671167
}
11681168
}
11691169

1170-
// Check that a function marked as `#[panic_implementation]` has signature `fn(&PanicInfo) -> !`
1170+
// Check that a function marked as `#[panic_handler]` has signature `fn(&PanicInfo) -> !`
11711171
if let Some(panic_impl_did) = fcx.tcx.lang_items().panic_impl() {
11721172
if panic_impl_did == fcx.tcx.hir.local_def_id(fn_id) {
11731173
if let Some(panic_info_did) = fcx.tcx.lang_items().panic_info() {

src/libsyntax/feature_gate.rs

+2-13
Original file line numberDiff line numberDiff line change
@@ -448,9 +448,6 @@ declare_features! (
448448
// Integer match exhaustiveness checking
449449
(active, exhaustive_integer_patterns, "1.30.0", Some(50907), None),
450450

451-
// RFC 2070: #[panic_implementation] / #[panic_handler]
452-
(active, panic_implementation, "1.28.0", Some(44489), None),
453-
454451
// #[doc(keyword = "...")]
455452
(active, doc_keyword, "1.28.0", Some(51315), None),
456453

@@ -541,6 +538,8 @@ declare_features! (
541538
Some("subsumed by `#![feature(proc_macro_hygiene)]`")),
542539
(removed, proc_macro_gen, "1.27.0", Some(54727), None,
543540
Some("subsumed by `#![feature(proc_macro_hygiene)]`")),
541+
(removed, panic_implementation, "1.28.0", Some(44489), None,
542+
Some("subsumed by `#[panic_handler]`")),
544543
);
545544

546545
declare_features! (
@@ -1160,16 +1159,6 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG
11601159
"infer 'static lifetime requirements",
11611160
cfg_fn!(infer_static_outlives_requirements))),
11621161

1163-
// RFC 2070 (deprecated attribute name)
1164-
("panic_implementation",
1165-
Normal,
1166-
Gated(Stability::Deprecated("https://github.com/rust-lang/rust/issues/44489\
1167-
#issuecomment-415140224",
1168-
Some("replace this attribute with `#[panic_handler]`")),
1169-
"panic_implementation",
1170-
"this attribute was renamed to `panic_handler`",
1171-
cfg_fn!(panic_implementation))),
1172-
11731162
// RFC 2070
11741163
("panic_handler", Normal, Ungated),
11751164

src/test/run-make/wasm-symbols-not-imported/foo.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
// except according to those terms.
1010

1111
#![crate_type = "cdylib"]
12-
13-
#![feature(panic_implementation)]
1412
#![no_std]
1513

1614
use core::panic::PanicInfo;
@@ -20,7 +18,7 @@ pub extern fn foo() {
2018
panic!()
2119
}
2220

23-
#[panic_implementation]
21+
#[panic_handler]
2422
fn panic(_info: &PanicInfo) -> ! {
2523
loop {}
2624
}

src/test/ui/feature-gates/feature-gate-panic-implementation.rs

-21
This file was deleted.

src/test/ui/feature-gates/feature-gate-panic-implementation.stderr

-11
This file was deleted.

src/test/ui/panic-implementation/panic-implementation-deprecated.rs

-24
This file was deleted.

src/test/ui/panic-implementation/panic-implementation-deprecated.stderr

-14
This file was deleted.

0 commit comments

Comments
 (0)