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