Ch10-03: Improve paragraph on error messages about 'static
#4067
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the section "The Static Lifetime", chapter 10-03.
Before:
After:
Here, I'm trying to address two things that I found weird about this paragraph:
The introductory phrase to the paragraph is not specific enough. The first time I read it, my immediate confusion was:
It never crossed my mind that this could be a suggestion coming from the compiler, because it doesn't read like it. It reads like it's talking about suggestions from other people (the default kind of suggestion). That was my first impression, at least. Then, the rest of the paragraph was very confusing as I was reading it from that perspective, and it didn't make any sense. I had to read it three times to finally realize I had misread the first phrase, and then it all made sense.
The phrase "and whether you want it to" reads like declaring lifetimes changes lifetimes at the will of the programmer, since it's just a matter of "want". However, in the section "Lifetime Annotation Syntax", a few folds above, it reads:
That reads more realistic, so I'm assuming that that holds true, and not that declaring lifetimes changes lifetimes. So I would like to propose that we drop the phrasing "and whether you want it to" from this paragraph, since I can't make something live for the entire lifetime of the program just by declaring it with
'static
.