@@ -368,23 +368,6 @@ impl NonConstOp for MutDeref {
368
368
}
369
369
}
370
370
371
- #[ derive( Debug ) ]
372
- pub struct Panic ;
373
- impl NonConstOp for Panic {
374
- fn status_in_item ( & self , _: & ConstCx < ' _ , ' _ > ) -> Status {
375
- Status :: Unstable ( sym:: const_panic)
376
- }
377
-
378
- fn build_error ( & self , ccx : & ConstCx < ' _ , ' tcx > , span : Span ) -> DiagnosticBuilder < ' tcx > {
379
- feature_err (
380
- & ccx. tcx . sess . parse_sess ,
381
- sym:: const_panic,
382
- span,
383
- & format ! ( "panicking in {}s is unstable" , ccx. const_kind( ) ) ,
384
- )
385
- }
386
- }
387
-
388
371
/// A call to a `panic()` lang item where the first argument is _not_ a `&str`.
389
372
#[ derive( Debug ) ]
390
373
pub struct PanicNonStr ;
@@ -407,7 +390,7 @@ impl NonConstOp for RawPtrComparison {
407
390
let mut err = ccx
408
391
. tcx
409
392
. sess
410
- . struct_span_err ( span, "pointers cannot be reliably compared during const eval. " ) ;
393
+ . struct_span_err ( span, "pointers cannot be reliably compared during const eval" ) ;
411
394
err. note (
412
395
"see issue #53020 <https://github.com/rust-lang/rust/issues/53020> \
413
396
for more information",
@@ -443,7 +426,7 @@ impl NonConstOp for RawPtrToIntCast {
443
426
let mut err = ccx
444
427
. tcx
445
428
. sess
446
- . struct_span_err ( span, "pointers cannot be cast to integers during const eval. " ) ;
429
+ . struct_span_err ( span, "pointers cannot be cast to integers during const eval" ) ;
447
430
err. note ( "at compile-time, pointers do not have an integer value" ) ;
448
431
err. note (
449
432
"avoiding this restriction via `transmute`, `union`, or raw pointers leads to compile-time undefined behavior" ,
0 commit comments