Skip to content

Commit 3882474

Browse files
authored
Merge pull request #2033 from tshepang/tuple-struct-extensions
add lifetime extension tests for tuple struct temporaries
2 parents 1536d89 + 76cd60a commit 3882474

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/destructors.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,11 @@ let x = &temp() as &dyn Send; // Operand of cast.
524524
# x;
525525
let x = (&*&temp(),); // Operand of tuple constructor.
526526
# x;
527+
struct W<T>(T);
528+
let x = W(&temp()); // Argument to tuple struct constructor.
529+
# x;
530+
let x = Some(&temp()); // Argument to tuple enum variant constructor.
531+
# x;
527532
let x = { [Some(&temp())] }; // Final expr of block.
528533
# x;
529534
let x = const { &temp() }; // Final expr of `const` block.

0 commit comments

Comments
 (0)