@@ -368,23 +368,6 @@ impl NonConstOp for MutDeref {
368368 }
369369}
370370
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-
388371/// A call to a `panic()` lang item where the first argument is _not_ a `&str`.
389372#[ derive( Debug ) ]
390373pub struct PanicNonStr ;
@@ -407,7 +390,7 @@ impl NonConstOp for RawPtrComparison {
407390 let mut err = ccx
408391 . tcx
409392 . 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" ) ;
411394 err. note (
412395 "see issue #53020 <https://github.com/rust-lang/rust/issues/53020> \
413396 for more information",
@@ -443,7 +426,7 @@ impl NonConstOp for RawPtrToIntCast {
443426 let mut err = ccx
444427 . tcx
445428 . 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" ) ;
447430 err. note ( "at compile-time, pointers do not have an integer value" ) ;
448431 err. note (
449432 "avoiding this restriction via `transmute`, `union`, or raw pointers leads to compile-time undefined behavior" ,
0 commit comments