-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Manual doesn't document the meaning of various single quote lifetime #8007
Comments
The backtick character is not used by rust source code in any way, if it appears in official documentation then that is an error. However, the single quote character is used for denoting lifetimes on borrowed pointers/references ( |
This is my poor eyesight ;) Does the manual document the how to read these lifetime references? (Editing Issue title to be single quote instead of backtick) |
It's documented in the borrowed pointer tutorial to some extent. The documentation is far from complete. |
Manual still needs updating: the current version says "Borrowed pointers are written &content, or in some cases &f/content for some lifetime-variable f, for example &int means a borrowed pointer to an integer." I didn't look at the tutorial, assuming it still needs work too WRT this issue. |
Nominating for milestone 1, well-defined |
1.0, high |
Still relevant, the manual doesn't specify the lifetime syntax, despite using it later on. The tutorial on lifetimes does have examples of the lifetime syntax. |
Nominating for removal from milestone. |
We can ship 1.0 without this, though it would be good to have this. Leaving as P-high, but removing from 1.0 milestone. |
The manual has "A reference type is written &'f type for some lifetime-variable f, or just &type when the lifetime can be elided;", and does have a bunch of information about lifetimes. Should this be closed? Should this be changed to |
There's been zero discussion here, and we do have the aforementioned sentence. If we have additional specific improvements that can be made, I'm open to it, but I think this can be closed. |
Add new lint `octal_escapes` This checks for sequences in strings that would be octal character escapes in C, but are not supported in Rust. It suggests either to use the `\x00` escape, or an equivalent hex escape if the octal was intended. Fixes rust-lang#7981 --- *Please write a short comment explaining your change (or "none" for internal only changes)* changelog: Add new lint [`octal_escapes`], which checks for literals like `"\033[0m"`.
[NOTE: I misread
'
as a backtick ]I've come across types with backticks aka `.
Examples (from memory, could be wrong):
From reading a presentation on memory I guess one use is to denote lifetype scope (???).
Since the compiler gives type errors that use backtick, it would be great to have a section on them.
The text was updated successfully, but these errors were encountered: