1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// use std::cell::RefCell;
// use std::ffi::c_void;
use Builder;
use ;
;
// #[test]
// #[cfg(feature = "multithread")]
// fn multithread_requires_no_send_types() {
// // struct NotSync {
// // s: RefCell<String>,
// // }
// // struct NotSyncNotSend {
// // s: *mut c_void,
// // }
// // fn is_send<T: Send>() {}
// // fn is_sync<T: Sync>() {}
// // fn is_send_sync<T: Send + Sync>() {}
// let registry = Registry::empty();
// registry.transient(|| NotSync {
// s: RefCell::new("Hello".to_owned()),
// });
// let _notsync = registry.transient::<NotSync>().unwrap();
// }
// #[test]
// fn is_send_sync() {
// fn is_send<T: Send>() {}
// fn is_sync<T: Sync>() {}
// is_send::<Registry>();
// is_sync::<Registry>();
// is_send::<Transient<u32>>();
// is_sync::<Transient<u32>>();
// is_send::<Singleton<u32>>();
// is_sync::<Singleton<u32>>();
// is_send::<Builder<'static, u32, ()>>();
// is_sync::<Builder<'static, u32, ()>>();
// }