rust/tests/ui/impl-trait/alias-liveness/rpit-hide-lifetime-for-swap.edition2024.stderr
Esteban Küber 8c3a033d7f Add edition checks for some tests that had divergent output
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.
2025-06-25 17:02:26 +00:00

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`.