Skip to content

Commit

Permalink
Rollup merge of #93658 - cchiw:issue-77443-fix, r=joshtriplett
Browse files Browse the repository at this point in the history
Stabilize `#[cfg(panic = "...")]`

[Stabilization PR](https://rustc-dev-guide.rust-lang.org/stabilization_guide.html#stabilization-pr) for #77443
  • Loading branch information
matthiaskrgr authored Feb 19, 2022
2 parents 4fa71ed + dbeab9c commit f19adc7
Show file tree
Hide file tree
Showing 11 changed files with 5 additions and 78 deletions.
2 changes: 2 additions & 0 deletions compiler/rustc_feature/src/accepted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ declare_features! (
(accepted, cfg_attr_multi, "1.33.0", Some(54881), None),
/// Allows the use of `#[cfg(doctest)]`, set when rustdoc is collecting doctests.
(accepted, cfg_doctest, "1.40.0", Some(62210), None),
/// Enables `#[cfg(panic = "...")]` config key.
(accepted, cfg_panic, "1.60.0", Some(77443), None),
/// Allows `cfg(target_feature = "...")`.
(accepted, cfg_target_feature, "1.27.0", Some(29717), None),
/// Allows `cfg(target_vendor = "...")`.
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_feature/src/active.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,6 @@ declare_features! (
(active, c_variadic, "1.34.0", Some(44930), None),
/// Allows capturing disjoint fields in a closure/generator (RFC 2229).
(incomplete, capture_disjoint_fields, "1.49.0", Some(53488), None),
/// Enables `#[cfg(panic = "...")]` config key.
(active, cfg_panic, "1.49.0", Some(77443), None),
/// Allows the use of `#[cfg(sanitize = "option")]`; set when -Zsanitizer is used.
(active, cfg_sanitize, "1.41.0", Some(39699), None),
/// Allows `cfg(target_abi = "...")`.
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_feature/src/builtin_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ const GATED_CFGS: &[GatedCfg] = &[
(sym::target_has_atomic_load_store, sym::cfg_target_has_atomic, cfg_fn!(cfg_target_has_atomic)),
(sym::sanitize, sym::cfg_sanitize, cfg_fn!(cfg_sanitize)),
(sym::version, sym::cfg_version, cfg_fn!(cfg_version)),
(sym::panic, sym::cfg_panic, cfg_fn!(cfg_panic)),
];

/// Find a gated cfg determined by the `pred`icate which is given the cfg's name.
Expand Down
2 changes: 1 addition & 1 deletion library/core/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#![feature(bool_to_option)]
#![feature(box_syntax)]
#![feature(cell_update)]
#![feature(cfg_panic)]
#![cfg_attr(bootstrap, feature(cfg_panic))]
#![cfg_attr(bootstrap, feature(cfg_target_has_atomic))]
#![feature(const_assume)]
#![feature(const_black_box)]
Expand Down
38 changes: 0 additions & 38 deletions src/doc/unstable-book/src/language-features/cfg-panic.md

This file was deleted.

2 changes: 1 addition & 1 deletion src/test/ui/cfg/cfg-panic-abort.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// build-pass
// compile-flags: -C panic=abort
// no-prefer-dynamic
#![feature(cfg_panic)]


#[cfg(panic = "unwind")]
pub fn bad() -> i32 { }
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/cfg/cfg-panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// ignore-emscripten no panic_unwind implementation
// ignore-wasm32 no panic_unwind implementation
// ignore-wasm64 no panic_unwind implementation
#![feature(cfg_panic)]


#[cfg(panic = "abort")]
pub fn bad() -> i32 { }
Expand Down
11 changes: 0 additions & 11 deletions src/test/ui/feature-gates/feature-gate-cfg-panic.rs

This file was deleted.

21 changes: 0 additions & 21 deletions src/test/ui/feature-gates/feature-gate-cfg-panic.stderr

This file was deleted.

1 change: 0 additions & 1 deletion src/test/ui/fmt/format-args-capture.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// run-pass
#![feature(cfg_panic)]

fn main() {
named_argument_takes_precedence_to_captured();
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/issues/issue-68696-catch-during-unwind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// entering the catch_unwind.
//
// run-pass
#![feature(cfg_panic)]

use std::panic::catch_unwind;

Expand Down

0 comments on commit f19adc7

Please sign in to comment.