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