The Default attribute can be #[derive(..)] d only if the contents of the output type also implement Default . This means that this feature becomes easier to use the more it is implemented. However, I notice that some types from std do not have implementations, although they have completely acceptable default values (sometimes depending on general parameters).
Mutex<T> and RWLock<T> can be implemented using new(_) ( where T: Default )CondVar can simply implement CondVar::new()Duration can get (to get zero duration , which is a reasonable default )
Is there a technical reason for these omissions?
source share