blob: ee411370d15fad43c6743d31fb1143388ad0b2da (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
#![feature(box_syntax)]
fn id<T>(x: T) -> T { x }
fn f<T:'static>(_: T) {}
fn main() {
let x: Box<_> = box 3;
f(x);
let x = &id(3); //~ ERROR borrowed value does not live long enough
f(x);
}
|