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

18 lines
381 B
Rust
Raw Permalink Normal View History

#[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 };
2018-12-03 14:03:54 +01:00
post_event!(&bus[CANCELLABLE.load(::std::sync::atomic::Ordering::Relaxed)], &mut event, MyEvent); //~ ERROR cannot find value `CANCELLABLE` in this scope
}