rust.eventbus/compiletest/compile-fail/hygiene/event_id.rs

18 lines
375 B
Rust

#[macro_use]
extern crate eventbus;
use eventbus::{Event, EventBus};
struct MyEvent {
i: i32
}
impl Event for MyEvent {
}
fn test_hygiene() {
let bus = [EventBus::new()];
let mut event = MyEvent { i: 3 };
post_event!(&bus[EVENT_ID.load(::std::sync::atomic::Ordering::Relaxed)], &mut event, MyEvent); //~ ERROR cannot find value `EVENT_ID` in this scope
}