You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use std::io::timer::Timer;use std::thread::Thread;use std::time::duration::Duration;fnmain(){letmut timer = Timer::new().unwrap();Thread::spawn(move || {
timer.sleep(Duration::seconds(1));});}
compiles on Linux. On windows it fails to compile with:
$ rustc wintimer.rs
wintimer.rs:7:5: 7:18 error: the trait `core::marker::Send` is not implemented for the type `*mut libc::types::common::c95::c_void`
wintimer.rs:7 Thread::spawn(move || {
^~~~~~~~~~~~~
I'm not sure if different behavior of timer on different OSs is an issue or somewhat "by design". For me the real issue was the unhelpful error message, that exposes an implementation detail but does not point to the part of the code that is actually wrong (where is c_void in my code? It's deep in the gut of the windows implementation for timer).
This code:
compiles on Linux. On windows it fails to compile with:
I'm not sure if different behavior of timer on different OSs is an issue or somewhat "by design". For me the real issue was the unhelpful error message, that exposes an implementation detail but does not point to the part of the code that is actually wrong (where is c_void in my code? It's deep in the gut of the windows implementation for timer).
The text was updated successfully, but these errors were encountered: