error[E0521]: borrowed data escapes outside of closure
--> tests/ui/frames_mut_escape.rs:25:9
|
23 | let mut escaped: Vec<&mut Frame> = Vec::new();
| ----------- `escaped` declared here, outside of the closure body
24 | let _ = report.frames_mut(|frame| {
| ----- `frame` is a reference that is only valid in the closure body
25 | escaped.push(frame);
| ^^^^^^^^^^^^^^^^^^^ `frame` escapes the closure body here
|
= note: requirement occurs because of a mutable reference to `Vec<&mut Frame>`
= note: mutable references are invariant over their type parameter
= help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance