diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-27105.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-27105.rs b/src/test/ui/issues/issue-27105.rs new file mode 100644 index 000000000..3339af364 --- /dev/null +++ b/src/test/ui/issues/issue-27105.rs @@ -0,0 +1,15 @@ +// check-pass +use std::cell::RefCell; +use std::rc::Rc; + +pub struct Callbacks { + callbacks: Vec<Rc<RefCell<dyn FnMut(i32)>>>, +} + +impl Callbacks { + pub fn register<F: FnMut(i32)+'static>(&mut self, callback: F) { + self.callbacks.push(Rc::new(RefCell::new(callback))); + } +} + +fn main() {} |