rust/tests/ui/issues/issue-27105.rs

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

16 lines
301 B
Rust
Raw Normal View History

// check-pass
2015-10-17 01:32:06 +00:00
use std::cell::RefCell;
use std::rc::Rc;
pub struct Callbacks {
2019-05-28 18:46:13 +00:00
callbacks: Vec<Rc<RefCell<dyn FnMut(i32)>>>,
2015-10-17 01:32:06 +00:00
}
impl Callbacks {
pub fn register<F: FnMut(i32)+'static>(&mut self, callback: F) {
self.callbacks.push(Rc::new(RefCell::new(callback)));
}
}
fn main() {}