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

Misleading documentation in std::option module #64844

Closed
jfrimmel opened this issue Sep 27, 2019 · 2 comments
Closed

Misleading documentation in std::option module #64844

jfrimmel opened this issue Sep 27, 2019 · 2 comments
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-bug Category: This is a bug.

Comments

@jfrimmel
Copy link
Contributor

The current std::option module states, that

Rust's pointer types must always point to a valid location; there are no "null" pointers.

Which is obviously wrong. There are no null references (&T), but there may be raw null pointers (*const T).
Maybe the docs should have used the terminology of smart pointers, which would be less misleading and be correct 😄

@jonas-schievink jonas-schievink added C-bug Category: This is a bug. A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools labels Sep 27, 2019
@steveklabnik
Copy link
Member

I'd accept a PR to change "pointer" to "reference" here.

hman523 added a commit to hman523/rust that referenced this issue Sep 30, 2019
tmandry added a commit to tmandry/rust that referenced this issue Sep 30, 2019
Fixed a misleading documentation issue rust-lang#64844

Made the suggested change from @steveklabnik on issue rust-lang#64844
tmandry added a commit to tmandry/rust that referenced this issue Sep 30, 2019
Fixed a misleading documentation issue rust-lang#64844

Made the suggested change from @steveklabnik on issue rust-lang#64844
bors added a commit that referenced this issue Oct 1, 2019
Rollup of 9 pull requests

Successful merges:

 - #64377 (Add long error explanation for E0493)
 - #64786 (Use https for curl when building for linux)
 - #64828 (Graphviz debug output for generic dataflow analysis)
 - #64838 (Add long error explanation for E0550)
 - #64891 (Fix `vec![x; n]` with null raw fat pointer zeroing the pointer metadata)
 - #64893 (Zero-initialize `vec![None; n]` for `Option<&T>`, `Option<&mut T>` and `Option<Box<T>>`)
 - #64911 (Fixed a misleading documentation issue #64844)
 - #64921 (Add test for issue-64662)
 - #64923 (Add missing links for mem::needs_drop)

Failed merges:

 - #64918 (Add long error explanation for E0551)

r? @ghost
@srinivasreddy
Copy link
Contributor

I think we can close this.

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 C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

4 participants