rust-lang / rust-lang/rust

Incorrect docs for comparing raw pointers to DST

Open
#157,640 2 comments 0 reactions 1 assignee View on GitHub

@asquared31415 is already working on this.

Since Jun 9, 2026.

A-docs A-DSTs A-raw-pointers needs-triage
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Location (URL)

https://doc.rust-lang.org/nightly/std/primitive.pointer.html#impl-PartialEq-for-*const+T
https://doc.rust-lang.org/nightly/std/primitive.pointer.html#impl-PartialOrd-for-*const+T

Summary

From my testing, comparing raw pointers that point to a DST (e.g., *const [u8]) seems to also compare the pointer metadata. However, the documentation says that it only compares the addresses.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.