From e6d3e0cf99dcde0dd660cea52998fa11c79f36d1 Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Tue, 20 Feb 2024 16:22:04 +0100 Subject: [PATCH] Extend temporary lifetime extension test. Co-authored-by: Daniel Henry-Mantilla --- tests/ui/lifetimes/temporary-lifetime-extension.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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:?}"); }