rust/tests/ui/explicit-tail-calls/ctfe-arg-bad-borrow.rs
2024-07-07 17:11:05 +02:00

15 lines
270 B
Rust

#![allow(incomplete_features)]
#![feature(explicit_tail_calls)]
pub const fn test(_: &Type) {
const fn takes_borrow(_: &Type) {}
let local = Type;
become takes_borrow(&local);
//~^ error: `local` does not live long enough
}
struct Type;
fn main() {}