fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69444 - pietroalbini:stable-next-final-v2-new, r=pietroalbinif3e1a954d2e

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