diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2024-02-20 16:22:04 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-20 16:22:04 +0100 |
| commit | e6d3e0cf99dcde0dd660cea52998fa11c79f36d1 (patch) | |
| tree | 82a655fccdeca125bf62003919e52a10c49e998f | |
| parent | bec765e5079c09fe9f32119d4f8b7a3ff818f4f2 (diff) | |
| download | rust-e6d3e0cf99dcde0dd660cea52998fa11c79f36d1.tar.gz rust-e6d3e0cf99dcde0dd660cea52998fa11c79f36d1.zip | |
Extend temporary lifetime extension test.
Co-authored-by: Daniel Henry-Mantilla <daniel.henry.mantilla@gmail.com>
| -rw-r--r-- | tests/ui/lifetimes/temporary-lifetime-extension.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/ui/lifetimes/temporary-lifetime-extension.rs b/tests/ui/lifetimes/temporary-lifetime-extension.rs index 477801f3273..193ca0b4d07 100644 --- a/tests/ui/lifetimes/temporary-lifetime-extension.rs +++ b/tests/ui/lifetimes/temporary-lifetime-extension.rs @@ -25,5 +25,8 @@ fn main() { &temp() } }; - println!("{a:?} {b:?} {c:?} {d:?} {e:?} {f:?} {g:?}"); + let h = match temp() { + owned_non_temporary => &{ owned_non_temporary }, + }; + println!("{a:?} {b:?} {c:?} {d:?} {e:?} {f:?} {g:?} {h:?}"); } |
