error-stack 0.8.0

A context-aware error-handling library that supports arbitrary attached user data
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
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