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