summaryrefslogtreecommitdiffstats
path: root/src/test/ui/lifetimes/issue-90600-expected-return-static-indirect.rs
blob: ce4cddc9b39b3f4fda356ba28463a51406f5831c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::cell::RefCell;
use std::io::Read;

fn main() {}

fn inner(mut foo: &[u8]) {
    let refcell = RefCell::new(&mut foo);
    //~^ ERROR `foo` does not live long enough
    let read = &refcell as &RefCell<dyn Read>;
    //~^ ERROR lifetime may not live long enough

    read_thing(read);
}

fn read_thing(refcell: &RefCell<dyn Read>) {}