This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +9
-15
lines changed
src/tools/clippy/tests/ui Expand file tree Collapse file tree 3 files changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -131,9 +131,9 @@ pub macro unreachable_2015 {
131
131
// cold function. This moves the codegen for setting up the
132
132
// arguments to the panic implementation function to the
133
133
// presumably cold panic path.
134
- ( ) => ( {
135
- $crate:: panicking:: unreachable_cold_explicit ( ) ;
136
- } ) ,
134
+ ( ) => (
135
+ $crate:: panicking:: unreachable_cold_explicit ( )
136
+ ) ,
137
137
( $msg: literal $( , ) ?) => ( {
138
138
#[ cold]
139
139
#[ track_caller]
@@ -165,9 +165,9 @@ pub macro unreachable_2015 {
165
165
) ]
166
166
#[ rustc_macro_transparency = "semitransparent" ]
167
167
pub macro unreachable_2021 {
168
- ( ) => ( {
169
- $crate:: panicking:: unreachable_cold_explicit ( ) ;
170
- } ) ,
168
+ ( ) => (
169
+ $crate:: panicking:: unreachable_cold_explicit ( )
170
+ ) ,
171
171
// Special-case the single-argument case for const_panic.
172
172
( "{}" , $arg: expr $( , ) ?) => ( {
173
173
#[ cold]
Original file line number Diff line number Diff line change @@ -261,13 +261,15 @@ pub const fn panic_str_2015(expr: &str) -> ! {
261
261
#[ cold]
262
262
#[ track_caller]
263
263
#[ inline( never) ]
264
+ #[ rustc_const_unstable( feature = "panic_internals" , issue = "none" ) ]
264
265
pub const fn panic_cold_explicit ( ) -> ! {
265
266
panic ( "explicit panic" ) ;
266
267
}
267
268
268
269
#[ cold]
269
270
#[ track_caller]
270
271
#[ inline( never) ]
272
+ #[ rustc_const_unstable( feature = "panic_internals" , issue = "none" ) ]
271
273
pub const fn unreachable_cold_explicit ( ) -> ! {
272
274
panic ( "internal error: entered unreachable code" ) ;
273
275
}
Original file line number Diff line number Diff line change @@ -37,13 +37,5 @@ error: initializer for `thread_local` value can be made `const`
37
37
LL | static PEEL_ME_MANY: i32 = { let x = 1; x * x };
38
38
| ^^^^^^^^^^^^^^^^^^^^ help: replace with: `const { { let x = 1; x * x } }`
39
39
40
- error: initializer for `thread_local` value can be made `const`
41
- --> tests/ui/missing_const_for_thread_local.rs:64:55
42
- |
43
- LL | static STATE_12637_UNREACHABLE: Cell<usize> = unreachable!();
44
- | ^^^^^^^^^^^^^^
45
- |
46
- = note: this error originates in the macro `$crate::panic::unreachable_2021` which comes from the expansion of the macro `unreachable` (in Nightly builds, run with -Z macro-backtrace for more info)
47
-
48
- error: aborting due to 7 previous errors
40
+ error: aborting due to 6 previous errors
49
41
You can’t perform that action at this time.
0 commit comments