3 // ignore-emscripten no threads support
4 // exec-env:RUSTC_LOG=debug
10 struct Foo(Cell<isize>);
12 impl fmt::Debug for Foo {
13 fn fmt(&self, _fmt: &mut fmt::Formatter) -> fmt::Result {
14 let Foo(ref f) = *self;
15 assert_eq!(f.get(), 0);
22 thread::spawn(move|| {
23 let mut f = Foo(Cell::new(0));
25 let Foo(ref mut f) = f;
26 assert_eq!(f.get(), 1);
27 }).join().ok().unwrap();