diff options
Diffstat (limited to 'tests/ui/lifetimes/tail-expr-in-nested-expr.rs')
| -rw-r--r-- | tests/ui/lifetimes/tail-expr-in-nested-expr.rs | 9 | 
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 +} | 
