rust/library
许杰友 Jieyou Xu (Joe) a23a93cb4e
Rollup merge of #135080 - Enselic:debug-ptr-metadata, r=thomcc
core: Make `Debug` impl of raw pointers print metadata if present

Make Rust pointers appear less magic by including metadata information in their `Debug` output.

This does not break Rust stability guarantees because `Debug` impl are explicitly exempted from stability:
https://doc.rust-lang.org/std/fmt/trait.Debug.html#stability

> ## Stability
>
> Derived `Debug` formats are not stable, and so may change with future Rust versions. Additionally, `Debug` implementations of types provided by the standard library (`std`, `core`, `alloc`, etc.) are not stable, and may also change with future Rust versions.

Note that a regression test is added as a separate commit to make it clear what impact the last commit has on the output.

Closes #128684 because the output of that code now becomes:

```
thread 'main' panicked at src/main.rs:5:5:
assertion `left == right` failed
  left: Pointer { addr: 0x7ffd45c6fc6b, metadata: 5 }
 right: Pointer { addr: 0x7ffd45c6fc6b, metadata: 3 }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
2025-03-16 13:19:51 +08:00
..
alloc Rollup merge of #138303 - DiuDiu777:rc-fix, r=Mark-Simulacrum 2025-03-16 09:40:06 +08:00
alloctests Add comments 2025-03-07 19:11:13 +00:00
backtrace@9d2c34e7e6 Update backtrace 2025-02-13 14:32:50 -08:00
core Rollup merge of #135080 - Enselic:debug-ptr-metadata, r=thomcc 2025-03-16 13:19:51 +08:00
coretests Rollup merge of #135080 - Enselic:debug-ptr-metadata, r=thomcc 2025-03-16 13:19:51 +08:00
panic_abort Migrate panic_abort to Rust 2024 2025-03-11 09:46:34 -07:00
panic_unwind Migrate panic_unwind to Rust 2024 2025-03-11 09:46:34 -07:00
portable-simd Remove ignored #[must_use] attributes from portable-simd 2025-02-12 13:59:22 +01:00
proc_macro Migrate proc_macro to Rust 2024 2025-03-11 09:46:34 -07:00
profiler_builtins Migrate profiler_builtins to Rust 2024 2025-03-11 09:46:35 -07:00
rtstartup Mark extern blocks as unsafe 2025-02-09 17:11:13 +00:00
rustc-std-workspace-alloc Migrated the rustc-std-workspace crates to Rust 2024 2025-03-11 09:46:35 -07:00
rustc-std-workspace-core Migrated the rustc-std-workspace crates to Rust 2024 2025-03-11 09:46:35 -07:00
rustc-std-workspace-std Migrated the rustc-std-workspace crates to Rust 2024 2025-03-11 09:46:35 -07:00
std Rollup merge of #138275 - folkertdev:expose-is-s390x-feature-detected, r=Mark-Simulacrum 2025-03-16 09:40:05 +08:00
stdarch@9426bb5658 Update stdarch 2025-03-06 11:11:55 -08:00
sysroot Migrate the sysroot crate to Rust 2024 2025-03-11 09:46:35 -07:00
test Migrate test to Rust 2024 2025-03-11 09:46:34 -07:00
unwind Rollup merge of #138162 - ehuss:library-2024, r=cuviper 2025-03-13 10:58:21 +01:00
windows_targets Migrate windows-targets to Rust 2024 2025-03-11 09:46:35 -07:00
Cargo.lock Rollup merge of #135080 - Enselic:debug-ptr-metadata, r=thomcc 2025-03-16 13:19:51 +08:00
Cargo.toml Move all alloc integration tests to a new alloctests crate 2025-03-07 19:11:11 +00:00