Skip to content

Commit 5acc59f

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

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/destructors.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,14 @@ let x = (&*&temp(),); // Operand of tuple constructor.
526526
# x;
527527
let x = { [Some(&temp())] }; // Final expr of block.
528528
# x;
529+
# struct TupleStruct<T>(T);
530+
let x = TupleStruct(&temp()); // Argument of tuple struct.
531+
# x;
532+
# enum Enum<T> {
533+
# TupleVariant(T),
534+
# }
535+
let x = Enum::TupleVariant(&temp()); // Argument of tuple enum variant.
536+
# x;
529537
let x = const { &temp() }; // Final expr of `const` block.
530538
# x;
531539
let x = unsafe { &temp() }; // Final expr of `unsafe` block.

0 commit comments

Comments
 (0)