rust/tests/ui/lifetimes/issue-90600-expected-return-static-indirect.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
342 B
Rust
Raw Normal View History

use std::cell::RefCell;
use std::io::Read;
fn main() {}
fn inner(mut foo: &[u8]) {
let refcell = RefCell::new(&mut foo);
2022-04-01 12:13:25 -05:00
//~^ ERROR `foo` does not live long enough
let read = &refcell as &RefCell<dyn Read>;
2022-04-01 12:13:25 -05:00
//~^ ERROR lifetime may not live long enough
read_thing(read);
}
fn read_thing(refcell: &RefCell<dyn Read>) {}