-
Couldn't load subscription status.
- Fork 558
add lifetime extension tests for tuple struct temporaries #2033
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
Merged
traviscross merged 2 commits into rust-lang:master from tshepang:tuple-struct-extensions Oct 5, 2025
Merged
add lifetime extension tests for tuple struct temporaries #2033
traviscross merged 2 commits into rust-lang:master from tshepang:tuple-struct-extensions Oct 5, 2025
Conversation
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
4306803 to 5acc59f Compare 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
| Thanks @tshepang. Made some revisions. See the commit message for details. |
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-actions bot 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)
Sign up for free to 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