rust/tests/ui/explicit-tail-calls/ctfe-arg-bad-borrow.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
270 B
Rust
Raw Normal View History

2023-06-28 10:34:10 -05:00
#![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() {}