Uh oh!
There was an error while loading. Please reload this page.
add lifetime extension tests for tuple struct temporaries - #2033
Merged
Conversation
tshepang
marked this pull request as draft
October 4, 2025 17:37
tshepangforce-pushed
the
tuple-struct-extensions
branch
from
October 4, 2025 18:10
4306803 to
5acc59fComparetshepang
marked this pull request as ready for review
October 4, 2025 18:11
The example for the tuple enum variant constructor should go above the example that already uses a tuple enum variant constructor in a nested manner. This also matches the order in the list of extending expressions above -- the list items for tuple struct constructors and tuple enum variant constructors come after tuple expressions and before block expressions. For demonstrating a tuple enum variant constructor, it's better to use `Some(_)` than to define one; `Option<T>` is well known enough. For the tuple struct that we need to define, let's use a short name like `W<T>` here rather than `TupleStruct<T>` (and show its definition). When I see a name like `TupleStruct`, it takes me a moment to confirm it's just a name and not more than that. We use this `W<T>(T)` "wrapper" tuple struct definition elsewhere in the Reference. As a wording matter, we say "argument to" rather than "argument of". Similarly, something isn't an argument to a tuple struct but an argument to the tuple struct constructor, so let's say that.
traviscross
approved these changes
Oct 5, 2025
traviscross
commented
Oct 5, 2025
Contributor
Thanks @tshepang. Made some revisions. See the commit message for details. |
Uh oh!
There was an error while loading. Please reload this page.
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)
github-actionsBot
pushed a commit
to rust-lang/miri
that referenced
this pull request
Oct 8, 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)
flip1995 pushed a commit
to flip1995/rust-clippy
that referenced
this pull request
Oct 18, 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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
matches #1813