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

Mention "null pointer optimization" in option docs. #85826

Merged
merged 1 commit into from
Jun 1, 2021
Merged

Conversation

jsha
Copy link
Contributor

@jsha jsha commented May 30, 2021

I had seen people discuss "null pointer optimization," but when I tried to find official documentation (using Google), the std::option page didn't show up, because it doesn't use that term. Hopefully adding the term will help others find it in the future.

@rust-highfive
Copy link
Collaborator

r? @scottmcm

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 30, 2021
@joshtriplett
Copy link
Member

Thanks for adding this!

I've never seen this written as "NPO" before; do you have any reference for that acronym being used?

@jsha
Copy link
Contributor Author

jsha commented May 31, 2021

Sure! Some examples I picked up by searching just now:

https://users.rust-lang.org/t/unsafe-rust-is-tough/48881
https://internals.rust-lang.org/t/pre-rfc-unsafe-enums-now-including-a-poll/2873/4?u=jsha
#27730 (comment)
https://www.reddit.com/r/rust/comments/cbttmh/null_pointer_optimization_only_applies_to_the/
https://discord.com/channels/442252698964721669/443150878111694848/820726682078937088

In my searches it was surprisingly less common than I expected. But I do recall having the experience of seeing someone write "NPO" in some chat environment (not the Discord link above; it was many months ago), and having to ask what it meant.

@joshtriplett
Copy link
Member

@jsha Thanks for the examples! That's more than enough to make it clear that the acronym is in use.

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 31, 2021

📌 Commit 79575a1 has been approved by joshtriplett

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 31, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 1, 2021
…laumeGomez

Rollup of 4 pull requests

Successful merges:

 - rust-lang#85473 (fix split-debuginfo error message)
 - rust-lang#85622 (Remove toggle for "undocumented items.")
 - rust-lang#85826 (Mention "null pointer optimization" in option docs.)
 - rust-lang#85860 (Fix details rustdoc toggle for blanket impl)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit f4d3f32 into rust-lang:master Jun 1, 2021
@rustbot rustbot added this to the 1.54.0 milestone Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants