Skip to content

Commit 4306803

Browse files
committed
add lifetime extension tests for tuple struct temporaries
1 parent 1536d89 commit 4306803

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/destructors.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,13 @@ let x = (&*&temp(),); // Operand of tuple constructor.
526526
# x;
527527
let x = { [Some(&temp())] }; // Final expr of block.
528528
# x;
529+
let x = Some(&temp()); // Argument of tuple struct.
530+
# x;
531+
# enum Enum<'a> {
532+
# Variant(&'a S),
533+
# }
534+
let x = Enum::Variant(&temp()); // Argument of tuple enum variant.
535+
# x;
529536
let x = const { &temp() }; // Final expr of `const` block.
530537
# x;
531538
let x = unsafe { &temp() }; // Final expr of `unsafe` block.

0 commit comments

Comments
 (0)