Skip to content

Commit 9f7ad5e

Browse files
committed
add a test for shortening super let binding lifetimes
1 parent 6c2246d commit 9f7ad5e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//! Some temporaries are implemented as local variables bound with `super let`. These can be
2+
//! lifetime-extended, and as such are subject to shortening after #145838.
3+
//@ edition: 2024
4+
//@ check-pass
5+
6+
fn main() {
7+
// The `()` argument to the inner `format_args!` is promoted, but the lifetimes of the internal
8+
// `super let` temporaries in its expansion shorten, making this an error in Rust 1.92.
9+
println!("{:?}{}", (), { format_args!("{:?}", ()) });
10+
// TODO: warn
11+
}

0 commit comments

Comments
 (0)