mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
add a test for shortening super let binding lifetimes
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
//! Some temporaries are implemented as local variables bound with `super let`. These can be
|
||||
//! lifetime-extended, and as such are subject to shortening after #145838.
|
||||
//@ edition: 2024
|
||||
//@ check-pass
|
||||
|
||||
fn main() {
|
||||
// The `()` argument to the inner `format_args!` is promoted, but the lifetimes of the internal
|
||||
// `super let` temporaries in its expansion shorten, making this an error in Rust 1.92.
|
||||
println!("{:?}{}", (), { format_args!("{:?}", ()) });
|
||||
// TODO: warn
|
||||
}
|
||||
Reference in New Issue
Block a user