rust.eventbus/tests/compile-fail/hygiene.rs

19 lines
330 B
Rust
Raw Permalink Normal View History

#[macro_use]
extern crate eventbus;
use eventbus::{Event, EventBus};
struct MyEvent {
i: i32
}
impl Event for MyEvent {
}
#[test]
fn test_hygiene() {
let bus = [EventBus::new()];
let mut event = MyEvent { i: 3 };
post_event!(&bus[EVENT_ID.load(::std::sync::atomic::Ordering::Relaxed)], MyEvent, &mut event);
}