diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-5192.rs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-5192.rs b/src/test/ui/issues/issue-5192.rs new file mode 100644 index 000000000..5a83d1c2f --- /dev/null +++ b/src/test/ui/issues/issue-5192.rs @@ -0,0 +1,41 @@ +// run-pass +#![allow(dead_code)] +// pretty-expanded FIXME #23616 + +#![feature(box_syntax)] + +pub trait EventLoop { + fn dummy(&self) { } +} + +pub struct UvEventLoop { + uvio: isize +} + +impl UvEventLoop { + pub fn new() -> UvEventLoop { + UvEventLoop { + uvio: 0 + } + } +} + +impl EventLoop for UvEventLoop { +} + +pub struct Scheduler { + event_loop: Box<dyn EventLoop+'static>, +} + +impl Scheduler { + + pub fn new(event_loop: Box<dyn EventLoop+'static>) -> Scheduler { + Scheduler { + event_loop: event_loop, + } + } +} + +pub fn main() { + let _sched = Scheduler::new(box UvEventLoop::new() as Box<dyn EventLoop>); +} |