From 7a5db9b0dda8595e6927f8ec5abbec074aa0f18d Mon Sep 17 00:00:00 2001 From: Cody Tapscott Date: Fri, 30 May 2025 13:09:57 -0400 Subject: [PATCH] Make `Ptr` types static-show w/ type-information --- src/rtutils.c | 7 ------- test/show.jl | 3 +++ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/rtutils.c b/src/rtutils.c index 4e82caa23af31..286e0e147581c 100644 --- a/src/rtutils.c +++ b/src/rtutils.c @@ -1065,13 +1065,6 @@ static size_t jl_static_show_x_(JL_STREAM *out, jl_value_t *v, jl_datatype_t *vt else if (vt == jl_uint8_type) { n += jl_printf(out, "0x%02" PRIx8, *(uint8_t*)v); } - else if (jl_pointer_type && jl_is_cpointer_type((jl_value_t*)vt)) { -#ifdef _P64 - n += jl_printf(out, "0x%016" PRIx64, *(uint64_t*)v); -#else - n += jl_printf(out, "0x%08" PRIx32, *(uint32_t*)v); -#endif - } else if (vt == jl_float16_type) { n += jl_static_show_float(out, julia_half_to_float(*(uint16_t *)v), vt); } diff --git a/test/show.jl b/test/show.jl index 8c9a1b655c047..8abd99cf95455 100644 --- a/test/show.jl +++ b/test/show.jl @@ -1595,6 +1595,9 @@ struct var"%X%" end # Invalid name without '#' Float16(1e4), 1f8, 1e17, Float16(-1e4), -1f8, -1e17, + # Pointers should round-trip + Ptr{Cvoid}(0), Ptr{Cvoid}(typemax(UInt)), Ptr{Any}(0), Ptr{Any}(typemax(UInt)), + # :var"" escaping rules differ from strings (#58484) :foo, :var"bar baz",