fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1error[E0597]: `a` does not live long enough 2 --> $DIR/regions-addr-of-arg.rs:5:30 3 | 4LL | fn foo(a: isize) { 5 | - binding `a` declared here 6LL | let _p: &'static isize = &a; 7 | -------------- ^^ borrowed value does not live long enough 8 | | 9 | type annotation requires that `a` is borrowed for `'static` 10LL | } 11 | - `a` dropped here while still borrowed 12 13error[E0515]: cannot return reference to function parameter `a` 14 --> $DIR/regions-addr-of-arg.rs:13:5 15 | 16LL | &a 17 | ^^ returns a reference to data owned by the current function 18 19error: aborting due to 2 previous errors 20 21Some errors have detailed explanations: E0515, E0597. 22For more information about an error, try `rustc --explain E0515`.