about summary refs log tree commit diff
path: root/tests/ui/lifetimes/tail-expr-in-nested-expr.rs
diff options
context:
space:
mode:
authorDing Xiang Fei <dingxiangfei2009@protonmail.ch>2024-04-12 23:24:45 +0800
committerDing Xiang Fei <dingxiangfei2009@protonmail.ch>2024-06-18 04:14:43 +0800
commit0f8c3f78825a1b6eb765b97f658b92252b55c5df (patch)
tree825b35aea3cd1ebbe53c2e9aaeec6012c30cb494 /tests/ui/lifetimes/tail-expr-in-nested-expr.rs
parent11380368dc53d0b2fc3a627408818eff1973ce9a (diff)
downloadrust-0f8c3f78825a1b6eb765b97f658b92252b55c5df.tar.gz
rust-0f8c3f78825a1b6eb765b97f658b92252b55c5df.zip
tail expression behind terminating scope
Diffstat (limited to 'tests/ui/lifetimes/tail-expr-in-nested-expr.rs')
-rw-r--r--tests/ui/lifetimes/tail-expr-in-nested-expr.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/lifetimes/tail-expr-in-nested-expr.rs b/tests/ui/lifetimes/tail-expr-in-nested-expr.rs
new file mode 100644
index 00000000000..a8989f22f4b
--- /dev/null
+++ b/tests/ui/lifetimes/tail-expr-in-nested-expr.rs
@@ -0,0 +1,9 @@
+//@ edition: 2024
+//@ compile-flags: -Zunstable-options
+
+#![feature(shorter_tail_lifetimes)]
+
+fn main() {
+    let _ = { String::new().as_str() }.len();
+    //~^ ERROR temporary value dropped while borrowed
+}