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

add missing 'static lifetime in docs #66465

Merged
merged 1 commit into from
Nov 17, 2019
Merged

add missing 'static lifetime in docs #66465

merged 1 commit into from
Nov 17, 2019

Conversation

mulimoen
Copy link
Contributor

No description provided.

The example refers to a static lifetime parameter that can be elided.
This parameter is not included, meaning lifetime elision is not shown.
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @rkruppe (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 16, 2019
@hanna-kruppe
Copy link
Contributor

Thanks for the PR! Just to avoid misunderstandings, could you say a bit about why you want to add the lifetime annotation? It isn't necessary to make this correct Rust (in consts and statics, omitted lifetimes default to 'static) but if the argument is that it's less confusing or something, that's fine by me!

@mulimoen
Copy link
Contributor Author

The docs explains what can be constants, including &'static. There are two examples showing this, one with the static lifetime, and then one showing how the compiler can elide this.

@mulimoen
Copy link
Contributor Author

https://doc.rust-lang.org/std/keyword.const.html is confusing as it refers to an explicit lifetime that is not visible in the docs ('static).

@hanna-kruppe
Copy link
Contributor

Oh, I see, that makes a lot of sense. Thanks!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Nov 16, 2019

📌 Commit e85f40c has been approved by rkruppe

@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 Nov 16, 2019
Centril added a commit to Centril/rust that referenced this pull request Nov 17, 2019
…hown, r=rkruppe

add missing 'static lifetime in docs
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Nov 17, 2019
…hown, r=rkruppe

add missing 'static lifetime in docs
bors added a commit that referenced this pull request Nov 17, 2019
Rollup of 11 pull requests

Successful merges:

 - #65739 (Improve documentation of `Vec::split_off(...)`)
 - #66271 (syntax: Keep string literals in ABIs and `asm!` more precisely)
 - #66344 (rustc_plugin: Remove `Registry::register_attribute`)
 - #66381 (find_deprecation: deprecation attr may be ill-formed meta.)
 - #66395 (Centralize panic macro documentation)
 - #66456 (Move `DIAGNOSTICS` usage to `rustc_driver`)
 - #66465 (add missing 'static lifetime in docs)
 - #66466 (miri panic_unwind: fix hack for SEH platforms)
 - #66469 (Use "field is never read" instead of "field is never used")
 - #66471 (Add test for issue 63116)
 - #66477 (Clarify transmute_copy documentation example)

Failed merges:

r? @ghost
@bors bors merged commit e85f40c into rust-lang:master Nov 17, 2019
@mulimoen mulimoen deleted the fix_lifetime_elision_not_shown branch November 17, 2019 07:54
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.

4 participants