blob: 8cb9bc0d80072bfbd400ac3fc905b6a40a1137c6 (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 | error[E0597]: `local` does not live long enough
  --> $DIR/trait-object-lifetime-default-note.rs:7:13
   |
LL |     let local = 0;
   |         ----- binding `local` declared here
LL |     let r = &local;
   |             ^^^^^^ borrowed value does not live long enough
...
LL |     require_box(Box::new(r));
   |                 ----------- coercion requires that `local` is borrowed for `'static`
...
LL | }
   | - `local` dropped here while still borrowed
   |
   = note: due to object lifetime defaults, `Box<dyn A>` actually means `Box<(dyn A + 'static)>`
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0597`.
 |