]>
Commit | Line | Data |
---|---|---|
923072b8 | 1 | error[E0597]: `foo` does not live long enough |
3c0e092e XL |
2 | --> $DIR/issue-90600-expected-return-static-indirect.rs:7:32 |
3 | | | |
3c0e092e | 4 | LL | let refcell = RefCell::new(&mut foo); |
923072b8 FG |
5 | | ^^^^^^^^ borrowed value does not live long enough |
6 | LL | | |
7 | LL | let read = &refcell as &RefCell<dyn Read>; | |
8 | | -------- cast requires that `foo` is borrowed for `'static` | |
9 | ... | |
10 | LL | } | |
11 | | - `foo` dropped here while still borrowed | |
12 | ||
13 | error: lifetime may not live long enough | |
14 | --> $DIR/issue-90600-expected-return-static-indirect.rs:9:16 | |
15 | | | |
16 | LL | fn inner(mut foo: &[u8]) { | |
17 | | - let's call the lifetime of this reference `'1` | |
3c0e092e | 18 | ... |
923072b8 FG |
19 | LL | let read = &refcell as &RefCell<dyn Read>; |
20 | | ^^^^^^^^ cast requires that `'1` must outlive `'static` | |
3c0e092e | 21 | |
923072b8 | 22 | error: aborting due to 2 previous errors |
3c0e092e | 23 | |
923072b8 | 24 | For more information about this error, try `rustc --explain E0597`. |