]> git.lizzy.rs Git - rust.git/blob - tests/ui/lifetimes/issue-90600-expected-return-static-indirect.stderr
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / lifetimes / issue-90600-expected-return-static-indirect.stderr
1 error[E0597]: `foo` does not live long enough
2   --> $DIR/issue-90600-expected-return-static-indirect.rs:7:32
3    |
4 LL |     let refcell = RefCell::new(&mut foo);
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`
18 ...
19 LL |     let read = &refcell as &RefCell<dyn Read>;
20    |                ^^^^^^^^ cast requires that `'1` must outlive `'static`
21
22 error: aborting due to 2 previous errors
23
24 For more information about this error, try `rustc --explain E0597`.