]> git.lizzy.rs Git - rust.git/blob - src/test/ui/static/static-region-bound.rs
Merge commit 'e9d1a0a7b0b28dd422f1a790ccde532acafbf193' into sync_cg_clif-2022-08-24
[rust.git] / src / test / ui / static / static-region-bound.rs
1 fn id<T>(x: T) -> T { x }
2
3 fn f<T:'static>(_: T) {}
4
5 fn main() {
6
7     let x: Box<_> = Box::new(3);
8     f(x);
9
10     let x = &id(3); //~ ERROR temporary value dropped while borrowed
11     f(x);
12 }