Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cover reference equality in primitive.reference API docs #54197

Closed
brson opened this issue Sep 13, 2018 · 3 comments
Closed

Cover reference equality in primitive.reference API docs #54197

brson opened this issue Sep 13, 2018 · 3 comments
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@brson
Copy link
Contributor

brson commented Sep 13, 2018

This page: https://doc.rust-lang.org/std/primitive.reference.html

It's not obvious that reference equality is accomplished via implicit reference-pointer coercion plus ptr::eq. The ptr::eq docs mention this, but I would not look there to find reference equality.

The reference primitive page is someplace I would look for info about reference equality. Update this page to discuss reference equality, and link to ptr::eq.

@Havvy Havvy added A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. labels Sep 13, 2018
@V1shvesh
Copy link
Contributor

Can I help with this issue?

@V1shvesh
Copy link
Contributor

@brson Still waiting for your reply

lucasloisp added a commit to lucasloisp/rust that referenced this issue Oct 2, 2018
Clarification of the use of `ptr::eq` to test equality of references
via address by pointer coercion
@QuietMisdreavus
Copy link
Member

@V1shvesh Sorry, it looks like @lucasloisp got to this now, in #54755.

pietroalbini added a commit to pietroalbini/rust that referenced this issue Oct 9, 2018
…ss-eq, r=QuietMisdreavus

Documents reference equality by address (rust-lang#54197)

Clarification of the use of `ptr::eq` to test equality of references via address by pointer coercion,  regarding issue rust-lang#54197 .

The same example as in `ptr::eq` docs is shown here to clarify that
`PartialEq` compares values pointed-to instead of via address (which can be desired in some cases)
pietroalbini added a commit to pietroalbini/rust that referenced this issue Oct 10, 2018
…ss-eq, r=QuietMisdreavus

Documents reference equality by address (rust-lang#54197)

Clarification of the use of `ptr::eq` to test equality of references via address by pointer coercion,  regarding issue rust-lang#54197 .

The same example as in `ptr::eq` docs is shown here to clarify that
`PartialEq` compares values pointed-to instead of via address (which can be desired in some cases)
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue Oct 11, 2018
…ss-eq, r=QuietMisdreavus

Documents reference equality by address (rust-lang#54197)

Clarification of the use of `ptr::eq` to test equality of references via address by pointer coercion,  regarding issue rust-lang#54197 .

The same example as in `ptr::eq` docs is shown here to clarify that
`PartialEq` compares values pointed-to instead of via address (which can be desired in some cases)
kennytm added a commit to kennytm/rust that referenced this issue Oct 12, 2018
…ss-eq, r=QuietMisdreavus

Documents reference equality by address (rust-lang#54197)

Clarification of the use of `ptr::eq` to test equality of references via address by pointer coercion,  regarding issue rust-lang#54197 .

The same example as in `ptr::eq` docs is shown here to clarify that
`PartialEq` compares values pointed-to instead of via address (which can be desired in some cases)
bors added a commit that referenced this issue Oct 12, 2018
Rollup of 16 pull requests

Successful merges:

 - #54755 (Documents reference equality by address (#54197))
 - #54811 (During rustc bootstrap, make default for `optimize` independent of `debug`)
 - #54825 (NLL says "borrowed content" instead of more precise "dereference of raw pointer")
 - #54860 (Add doc comments about safest way to initialize a vector of zeros)
 - #54869 (Fix mobile docs)
 - #54891 (Fix tracking issue for Once::is_completed)
 - #54913 (doc fix: it's auto traits that make for automatic implementations)
 - #54920 (Fix handling of #[must_use] on unit and uninhabited types)
 - #54932 (A handful of random string-related improvements)
 - #54936 (impl Eq+Hash for TyLayout)
 - #54950 (std: Synchronize global allocator on wasm32)
 - #54956 ("(using ..." doesn't have the matching ")")
 - #54958 (add a macro for static (compile-time) assertions)
 - #54967 (Remove incorrect span for second label inner macro invocation)
 - #54983 (Fix slice's benchmarks)
 - #54989 (Fix spelling in the documentation to htmldocck.py)

Failed merges:

r? @ghost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

4 participants