Skip to content

Commit 9193d79

Browse files
authored
Unrolled build for rust-lang#118781
Rollup merge of rust-lang#118781 - RalfJung:core-panic-feature, r=the8472 merge core_panic feature into panic_internals I don't know why those are two separate features, but it does not seem intentional. This merge is useful because with rust-lang#118123, panic_internals is recognized as an internal feature, but core_panic is not -- but core_panic definitely should be internal.
2 parents 9212108 + af4913f commit 9193d79

File tree

9 files changed

+26
-32
lines changed

9 files changed

+26
-32
lines changed

library/alloc/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@
120120
#![feature(const_size_of_val)]
121121
#![feature(const_waker)]
122122
#![feature(core_intrinsics)]
123-
#![feature(core_panic)]
124123
#![feature(deprecated_suggestion)]
125124
#![feature(dispatch_from_dyn)]
126125
#![feature(error_generic_member_access)]
@@ -139,6 +138,7 @@
139138
#![feature(maybe_uninit_slice)]
140139
#![feature(maybe_uninit_uninit_array)]
141140
#![feature(maybe_uninit_uninit_array_transpose)]
141+
#![feature(panic_internals)]
142142
#![feature(pattern)]
143143
#![feature(ptr_internals)]
144144
#![feature(ptr_metadata)]

library/core/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@
167167
#![feature(const_unicode_case_lookup)]
168168
#![feature(const_unsafecell_get_mut)]
169169
#![feature(const_waker)]
170-
#![feature(core_panic)]
171170
#![feature(coverage_attribute)]
172171
#![feature(duration_consts_float)]
173172
#![feature(internal_impls_macro)]
@@ -179,6 +178,7 @@
179178
#![feature(non_null_convenience)]
180179
#![feature(offset_of)]
181180
#![feature(offset_of_enum)]
181+
#![feature(panic_internals)]
182182
#![feature(ptr_alignment_type)]
183183
#![feature(ptr_metadata)]
184184
#![feature(set_ptr_value)]

library/core/src/macros/mod.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ macro_rules! panic {
3232
#[macro_export]
3333
#[stable(feature = "rust1", since = "1.0.0")]
3434
#[cfg_attr(not(test), rustc_diagnostic_item = "assert_eq_macro")]
35-
#[allow_internal_unstable(core_panic)]
35+
#[allow_internal_unstable(panic_internals)]
3636
macro_rules! assert_eq {
3737
($left:expr, $right:expr $(,)?) => {
3838
match (&$left, &$right) {
@@ -82,7 +82,7 @@ macro_rules! assert_eq {
8282
#[macro_export]
8383
#[stable(feature = "assert_ne", since = "1.13.0")]
8484
#[cfg_attr(not(test), rustc_diagnostic_item = "assert_ne_macro")]
85-
#[allow_internal_unstable(core_panic)]
85+
#[allow_internal_unstable(panic_internals)]
8686
macro_rules! assert_ne {
8787
($left:expr, $right:expr $(,)?) => {
8888
match (&$left, &$right) {
@@ -139,7 +139,7 @@ macro_rules! assert_ne {
139139
/// assert_matches!(c, Ok(x) | Err(x) if x.len() < 100);
140140
/// ```
141141
#[unstable(feature = "assert_matches", issue = "82775")]
142-
#[allow_internal_unstable(core_panic)]
142+
#[allow_internal_unstable(panic_internals)]
143143
#[rustc_macro_transparency = "semitransparent"]
144144
pub macro assert_matches {
145145
($left:expr, $(|)? $( $pattern:pat_param )|+ $( if $guard: expr )? $(,)?) => {
@@ -787,7 +787,7 @@ macro_rules! unreachable {
787787
#[macro_export]
788788
#[stable(feature = "rust1", since = "1.0.0")]
789789
#[cfg_attr(not(test), rustc_diagnostic_item = "unimplemented_macro")]
790-
#[allow_internal_unstable(core_panic)]
790+
#[allow_internal_unstable(panic_internals)]
791791
macro_rules! unimplemented {
792792
() => {
793793
$crate::panicking::panic("not implemented")
@@ -867,7 +867,7 @@ macro_rules! unimplemented {
867867
#[macro_export]
868868
#[stable(feature = "todo_macro", since = "1.40.0")]
869869
#[cfg_attr(not(test), rustc_diagnostic_item = "todo_macro")]
870-
#[allow_internal_unstable(core_panic)]
870+
#[allow_internal_unstable(panic_internals)]
871871
macro_rules! todo {
872872
() => {
873873
$crate::panicking::panic("not yet implemented")
@@ -1534,7 +1534,7 @@ pub(crate) mod builtin {
15341534
#[rustc_builtin_macro]
15351535
#[macro_export]
15361536
#[rustc_diagnostic_item = "assert_macro"]
1537-
#[allow_internal_unstable(core_panic, edition_panic, generic_assert_internals)]
1537+
#[allow_internal_unstable(panic_internals, edition_panic, generic_assert_internals)]
15381538
macro_rules! assert {
15391539
($cond:expr $(,)?) => {{ /* compiler built-in */ }};
15401540
($cond:expr, $($arg:tt)+) => {{ /* compiler built-in */ }};

library/core/src/panic.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub use self::unwind_safe::{AssertUnwindSafe, RefUnwindSafe, UnwindSafe};
1717

1818
#[doc(hidden)]
1919
#[unstable(feature = "edition_panic", issue = "none", reason = "use panic!() instead")]
20-
#[allow_internal_unstable(core_panic, const_format_args)]
20+
#[allow_internal_unstable(panic_internals, const_format_args)]
2121
#[rustc_diagnostic_item = "core_panic_2015_macro"]
2222
#[rustc_macro_transparency = "semitransparent"]
2323
pub macro panic_2015 {
@@ -44,7 +44,7 @@ pub macro panic_2015 {
4444

4545
#[doc(hidden)]
4646
#[unstable(feature = "edition_panic", issue = "none", reason = "use panic!() instead")]
47-
#[allow_internal_unstable(core_panic, const_format_args)]
47+
#[allow_internal_unstable(panic_internals, const_format_args)]
4848
#[rustc_diagnostic_item = "core_panic_2021_macro"]
4949
#[rustc_macro_transparency = "semitransparent"]
5050
#[cfg(feature = "panic_immediate_abort")]
@@ -66,7 +66,7 @@ pub macro panic_2021 {
6666
#[doc(hidden)]
6767
#[unstable(feature = "edition_panic", issue = "none", reason = "use panic!() instead")]
6868
#[allow_internal_unstable(
69-
core_panic,
69+
panic_internals,
7070
core_intrinsics,
7171
const_dispatch,
7272
const_eval_select,
@@ -109,7 +109,7 @@ pub macro panic_2021 {
109109

110110
#[doc(hidden)]
111111
#[unstable(feature = "edition_panic", issue = "none", reason = "use unreachable!() instead")]
112-
#[allow_internal_unstable(core_panic)]
112+
#[allow_internal_unstable(panic_internals)]
113113
#[rustc_diagnostic_item = "unreachable_2015_macro"]
114114
#[rustc_macro_transparency = "semitransparent"]
115115
pub macro unreachable_2015 {
@@ -128,7 +128,7 @@ pub macro unreachable_2015 {
128128

129129
#[doc(hidden)]
130130
#[unstable(feature = "edition_panic", issue = "none", reason = "use unreachable!() instead")]
131-
#[allow_internal_unstable(core_panic)]
131+
#[allow_internal_unstable(panic_internals)]
132132
#[rustc_macro_transparency = "semitransparent"]
133133
pub macro unreachable_2021 {
134134
() => (
@@ -145,8 +145,8 @@ pub macro unreachable_2021 {
145145
/// unwind. For example, checks in `_unchecked` functions that are intended for debugging but should
146146
/// not compromise unwind safety.
147147
#[doc(hidden)]
148-
#[unstable(feature = "core_panic", issue = "none")]
149-
#[allow_internal_unstable(core_panic, const_format_args)]
148+
#[unstable(feature = "panic_internals", issue = "none")]
149+
#[allow_internal_unstable(panic_internals, const_format_args)]
150150
#[rustc_macro_transparency = "semitransparent"]
151151
pub macro debug_assert_nounwind {
152152
($cond:expr $(,)?) => {

library/core/src/panicking.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
2222
#![allow(dead_code, missing_docs)]
2323
#![unstable(
24-
feature = "core_panic",
24+
feature = "panic_internals",
2525
reason = "internal details of the implementation of the `panic!` and related macros",
2626
issue = "none"
2727
)]
@@ -48,7 +48,7 @@ const _: () = assert!(cfg!(panic = "abort"), "panic_immediate_abort requires -C
4848
#[track_caller]
4949
#[lang = "panic_fmt"] // needed for const-evaluated panics
5050
#[rustc_do_not_const_check] // hooked by const-eval
51-
#[rustc_const_unstable(feature = "core_panic", issue = "none")]
51+
#[rustc_const_unstable(feature = "panic_internals", issue = "none")]
5252
pub const fn panic_fmt(fmt: fmt::Arguments<'_>) -> ! {
5353
if cfg!(feature = "panic_immediate_abort") {
5454
super::intrinsics::abort()
@@ -82,7 +82,7 @@ pub const fn panic_fmt(fmt: fmt::Arguments<'_>) -> ! {
8282
// and unwinds anyway, we will hit the "unwinding out of nounwind function" guard,
8383
// which causes a "panic in a function that cannot unwind".
8484
#[rustc_nounwind]
85-
#[rustc_const_unstable(feature = "core_panic", issue = "none")]
85+
#[rustc_const_unstable(feature = "panic_internals", issue = "none")]
8686
pub const fn panic_nounwind_fmt(fmt: fmt::Arguments<'_>, force_no_backtrace: bool) -> ! {
8787
#[inline] // this should always be inlined into `panic_nounwind_fmt`
8888
#[track_caller]
@@ -132,7 +132,7 @@ pub const fn panic_nounwind_fmt(fmt: fmt::Arguments<'_>, force_no_backtrace: boo
132132
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never), cold)]
133133
#[cfg_attr(feature = "panic_immediate_abort", inline)]
134134
#[track_caller]
135-
#[rustc_const_unstable(feature = "core_panic", issue = "none")]
135+
#[rustc_const_unstable(feature = "panic_internals", issue = "none")]
136136
#[lang = "panic"] // needed by codegen for panic on overflow and other `Assert` MIR terminators
137137
pub const fn panic(expr: &'static str) -> ! {
138138
// Use Arguments::new_v1 instead of format_args!("{expr}") to potentially
@@ -150,7 +150,7 @@ pub const fn panic(expr: &'static str) -> ! {
150150
#[cfg_attr(feature = "panic_immediate_abort", inline)]
151151
#[lang = "panic_nounwind"] // needed by codegen for non-unwinding panics
152152
#[rustc_nounwind]
153-
#[rustc_const_unstable(feature = "core_panic", issue = "none")]
153+
#[rustc_const_unstable(feature = "panic_internals", issue = "none")]
154154
pub const fn panic_nounwind(expr: &'static str) -> ! {
155155
panic_nounwind_fmt(fmt::Arguments::new_const(&[expr]), /* force_no_backtrace */ false);
156156
}
@@ -166,15 +166,15 @@ pub fn panic_nounwind_nobacktrace(expr: &'static str) -> ! {
166166
#[inline]
167167
#[track_caller]
168168
#[rustc_diagnostic_item = "panic_str"]
169-
#[rustc_const_unstable(feature = "core_panic", issue = "none")]
169+
#[rustc_const_unstable(feature = "panic_internals", issue = "none")]
170170
pub const fn panic_str(expr: &str) -> ! {
171171
panic_display(&expr);
172172
}
173173

174174
#[track_caller]
175175
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never), cold)]
176176
#[cfg_attr(feature = "panic_immediate_abort", inline)]
177-
#[rustc_const_unstable(feature = "core_panic", issue = "none")]
177+
#[rustc_const_unstable(feature = "panic_internals", issue = "none")]
178178
pub const fn panic_explicit() -> ! {
179179
panic_display(&"explicit panic");
180180
}
@@ -191,7 +191,7 @@ pub fn unreachable_display<T: fmt::Display>(x: &T) -> ! {
191191
#[rustc_do_not_const_check] // hooked by const-eval
192192
// enforce a &&str argument in const-check and hook this by const-eval
193193
#[rustc_const_panic_str]
194-
#[rustc_const_unstable(feature = "core_panic", issue = "none")]
194+
#[rustc_const_unstable(feature = "panic_internals", issue = "none")]
195195
pub const fn panic_display<T: fmt::Display>(x: &T) -> ! {
196196
panic_fmt(format_args!("{}", *x));
197197
}
@@ -258,7 +258,7 @@ fn panic_in_cleanup() -> ! {
258258

259259
/// This function is used instead of panic_fmt in const eval.
260260
#[lang = "const_panic_fmt"]
261-
#[rustc_const_unstable(feature = "core_panic", issue = "none")]
261+
#[rustc_const_unstable(feature = "panic_internals", issue = "none")]
262262
pub const fn const_panic_fmt(fmt: fmt::Arguments<'_>) -> ! {
263263
if let Some(msg) = fmt.as_str() {
264264
// The panic_display function is hooked by const eval.

library/std/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,6 @@
374374
#![feature(cfg_eval)]
375375
#![feature(concat_bytes)]
376376
#![feature(const_format_args)]
377-
#![feature(core_panic)]
378377
#![feature(custom_test_frameworks)]
379378
#![feature(edition_panic)]
380379
#![feature(format_args_nl)]

library/std/src/panic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use crate::thread::Result;
1111

1212
#[doc(hidden)]
1313
#[unstable(feature = "edition_panic", issue = "none", reason = "use panic!() instead")]
14-
#[allow_internal_unstable(libstd_sys_internals, const_format_args, core_panic, rt)]
14+
#[allow_internal_unstable(libstd_sys_internals, const_format_args, panic_internals, rt)]
1515
#[cfg_attr(not(test), rustc_diagnostic_item = "std_panic_2015_macro")]
1616
#[rustc_macro_transparency = "semitransparent"]
1717
pub macro panic_2015 {

src/doc/unstable-book/src/library-features/core-panic.md

-5
This file was deleted.

tests/ui/extern/issue-64655-allow-unwind-when-calling-panic-directly.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
//[thin]compile-flags: -C lto=thin
2323
//[fat]compile-flags: -C lto=fat
2424

25-
#![feature(core_panic)]
25+
#![feature(panic_internals)]
2626

2727
// (For some reason, reproducing the LTO issue requires pulling in std
2828
// explicitly this way.)

0 commit comments

Comments
 (0)