mirror of
https://github.com/rust-lang/rust.git
synced 2025-11-25 20:56:47 +00:00
In order to expose edition dependent divergences in some tests in the test suite, add explicit `edition` annotations. Some of these tests might require additional work to *avoid* the divergences, as they might have been unintentional. These are not exhaustive changes, purely opportunistic while looking at something else.
18 lines
629 B
Plaintext
18 lines
629 B
Plaintext
error[E0597]: `x` does not live long enough
|
|
--> $DIR/rpit-hide-lifetime-for-swap.rs:27:38
|
|
|
|
|
LL | let x = [1, 2, 3];
|
|
| - binding `x` declared here
|
|
LL | let short = Rc::new(RefCell::new(&x));
|
|
| ^^ borrowed value does not live long enough
|
|
...
|
|
LL | let res: &'static [i32; 3] = *long.borrow();
|
|
| ----------------- type annotation requires that `x` is borrowed for `'static`
|
|
LL | res
|
|
LL | }
|
|
| - `x` dropped here while still borrowed
|
|
|
|
error: aborting due to 1 previous error
|
|
|
|
For more information about this error, try `rustc --explain E0597`.
|