rust/library/coretests/tests
许杰友 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
..
async_iter Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
ffi Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
fmt core: Make Debug impl of raw pointers print metadata if present 2025-02-15 17:27:55 +01:00
hash library: Use size_of from the prelude instead of imported 2025-03-06 20:20:38 -08:00
io Migrate coretests to Rust 2024 2025-02-13 13:10:21 -08:00
iter Rustfmt 2025-02-08 22:12:13 +00:00
net Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
num Update tests. 2025-03-10 12:20:05 +01:00
ops Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
panic Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
alloc.rs library: Use size_of from the prelude instead of imported 2025-03-06 20:20:38 -08:00
any.rs Optionally add type names to TypeIds. 2025-02-11 18:42:19 -08:00
array.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
ascii.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
ascii_char.rs Implement Extend<AsciiChar> for String 2025-02-08 16:51:04 -05:00
asserting.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
atomic.rs library: Use size_of from the prelude instead of imported 2025-03-06 20:20:38 -08:00
bool.rs Remove some unnecessary parens in assert! conditions 2025-02-06 22:28:44 +00:00
bstr.rs Actually run the bstr test 2025-01-26 10:45:09 +00:00
cell.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
char.rs add MAX_LEN_UTF8 and MAX_LEN_UTF16 constants 2025-02-16 21:08:38 +08:00
clone.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
cmp.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
const_ptr.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
convert.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
error.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
ffi.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
future.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
intrinsics.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
lazy.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
lib.rs Rollup merge of #137728 - Darksonn:no-tuple-unsize, r=oli-obk 2025-03-05 21:46:44 +08:00
macros.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
manually_drop.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
mem.rs Mark extern blocks as unsafe 2025-02-09 17:11:13 +00:00
nonzero.rs library: Use size_of from the prelude instead of imported 2025-03-06 20:20:38 -08:00
ops.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
option.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
panic.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
pattern.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
pin.rs Migrate coretests to Rust 2024 2025-02-13 13:10:21 -08:00
pin_macro.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
ptr.rs Rollup merge of #138034 - thaliaarchi:use-prelude-size-of, r=tgross35 2025-03-07 10:12:44 +01:00
result.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
simd.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
slice.rs Rollup merge of #138034 - thaliaarchi:use-prelude-size-of, r=tgross35 2025-03-07 10:12:44 +01:00
str.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
str_lossy.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
task.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
time.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
tuple.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
unicode.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00
waker.rs Put all coretests in a separate crate 2025-01-26 10:26:36 +00:00