Skip to content

Conversation

traviscross
Copy link
Contributor

@traviscross traviscross commented Oct 5, 2025

The introduction of the Destructors chapter says:

When an initialized variable or temporary goes out of scope, its destructor is run, or it is dropped.

Grammatically, the final comma there suggests that the clause "or it is dropped" is non-restrictive -- i.e., that it could be removed from the sentence without changing its meaning. It's as though we had written:

When an initialized variable or temporary goes out of scope, its destructor is run, or in other words, it is dropped.

That's not what we mean here currently, as discussed in rust-lang/reference#1078, so the comma is incorrectly placed.

Note that this isn't necessarily the final step in clarifying this. There's more we should probably do. But it is a step in the right direction, so let's take it.

cc @ehuss @joshtriplett #1078

The introduction of the *Destructors* chapter says:

> When an initialized variable or temporary goes out of scope,
> its *destructor* is run, or it is *dropped*.

Grammatically, the final comma there suggests that the clause "or it
is dropped" is non-restrictive -- i.e., that it could be removed from
the sentence without changing its meaning.  It's as though we had
written:

> When an initialized variable or temporary goes out of scope,
> its *destructor* is run, or in other words, it is *dropped*.

That's not what we mean here currently, as discussed in [#1078], so
the comma is incorrectly placed.

Note that this isn't necessarily the final step in clarifying this.
There's more we should probably do.  But it is a step in the right
direction, so let's take it.

[#1078]: #1078
@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Oct 5, 2025
Copy link
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ehuss ehuss added this pull request to the merge queue Oct 6, 2025
Merged via the queue into master with commit 8efb980 Oct 6, 2025
5 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Oct 6, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 7, 2025
Update books

## rust-lang/reference

4 commits in e11adf6016a362766eea5a3f9832e193994dd0c8..8efb9805686722dba511b7b27281bb6b77d32130
2025-10-06 15:04:20 UTC to 2025-10-01 17:30:01 UTC

- Clarify that "or it is dropped" is meant restrictively (rust-lang/reference#2035)
- add lifetime extension tests for tuple struct temporaries (rust-lang/reference#2033)
- Add `target_env = "macabi"` and `target_env = "sim"` (rust-lang/reference#1781)
- Typo fixes for the Tokens page (additions -> editions) (rust-lang/reference#2031)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 7, 2025
Update books

## rust-lang/reference

4 commits in e11adf6016a362766eea5a3f9832e193994dd0c8..8efb9805686722dba511b7b27281bb6b77d32130
2025-10-06 15:04:20 UTC to 2025-10-01 17:30:01 UTC

- Clarify that "or it is dropped" is meant restrictively (rust-lang/reference#2035)
- add lifetime extension tests for tuple struct temporaries (rust-lang/reference#2033)
- Add `target_env = "macabi"` and `target_env = "sim"` (rust-lang/reference#1781)
- Typo fixes for the Tokens page (additions -> editions) (rust-lang/reference#2031)
rust-timer added a commit to rust-lang/rust that referenced this pull request Oct 7, 2025
Rollup merge of #147407 - rustbot:docs-update, r=ehuss

Update books

## rust-lang/reference

4 commits in e11adf6016a362766eea5a3f9832e193994dd0c8..8efb9805686722dba511b7b27281bb6b77d32130
2025-10-06 15:04:20 UTC to 2025-10-01 17:30:01 UTC

- Clarify that "or it is dropped" is meant restrictively (rust-lang/reference#2035)
- add lifetime extension tests for tuple struct temporaries (rust-lang/reference#2033)
- Add `target_env = "macabi"` and `target_env = "sim"` (rust-lang/reference#1781)
- Typo fixes for the Tokens page (additions -> editions) (rust-lang/reference#2031)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants