File tree Expand file tree Collapse file tree 4 files changed +10
-11
lines changed Expand file tree Collapse file tree 4 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -1529,9 +1529,9 @@ dependencies = [
15291529
15301530[[package ]]
15311531name = " hermit-abi"
1532- version = " 0.3.1 "
1532+ version = " 0.3.2 "
15331533source = " registry+https://github.com/rust-lang/crates.io-index"
1534- checksum = " fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286 "
1534+ checksum = " 443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b "
15351535dependencies = [
15361536 " compiler_builtins" ,
15371537 " rustc-std-workspace-alloc" ,
@@ -1864,7 +1864,7 @@ version = "1.0.11"
18641864source = " registry+https://github.com/rust-lang/crates.io-index"
18651865checksum = " eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2"
18661866dependencies = [
1867- " hermit-abi 0.3.1 " ,
1867+ " hermit-abi 0.3.2 " ,
18681868 " libc" ,
18691869 " windows-sys 0.48.0" ,
18701870]
@@ -1881,7 +1881,7 @@ version = "0.4.8"
18811881source = " registry+https://github.com/rust-lang/crates.io-index"
18821882checksum = " 24fddda5af7e54bf7da53067d6e802dbcc381d0a8eef629df528e3ebf68755cb"
18831883dependencies = [
1884- " hermit-abi 0.3.1 " ,
1884+ " hermit-abi 0.3.2 " ,
18851885 " rustix 0.38.2" ,
18861886 " windows-sys 0.48.0" ,
18871887]
@@ -2396,7 +2396,7 @@ version = "1.16.0"
23962396source = " registry+https://github.com/rust-lang/crates.io-index"
23972397checksum = " 4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43"
23982398dependencies = [
2399- " hermit-abi 0.3.1 " ,
2399+ " hermit-abi 0.3.2 " ,
24002400 " libc" ,
24012401]
24022402
@@ -4819,7 +4819,7 @@ dependencies = [
48194819 " dlmalloc" ,
48204820 " fortanix-sgx-abi" ,
48214821 " hashbrown 0.14.0" ,
4822- " hermit-abi 0.3.1 " ,
4822+ " hermit-abi 0.3.2 " ,
48234823 " libc" ,
48244824 " miniz_oxide" ,
48254825 " object" ,
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ dlmalloc = { version = "0.2.3", features = ['rustc-dep-of-std'] }
4545fortanix-sgx-abi = { version = " 0.5.0" , features = [' rustc-dep-of-std' ], public = true }
4646
4747[target .'cfg(target_os = "hermit")' .dependencies ]
48- hermit-abi = { version = " 0.3.0 " , features = [' rustc-dep-of-std' ] }
48+ hermit-abi = { version = " 0.3.2 " , features = [' rustc-dep-of-std' ], public = true }
4949
5050[target .wasm32-wasi .dependencies ]
5151wasi = { version = " 0.11.0" , features = [' rustc-dep-of-std' ], default-features = false }
Original file line number Diff line number Diff line change 11#![ allow( dead_code) ]
22
3- use super :: unsupported;
43use crate :: ffi:: CStr ;
54use crate :: io;
65use crate :: mem;
@@ -99,7 +98,7 @@ impl Thread {
9998}
10099
101100pub fn available_parallelism ( ) -> io:: Result < NonZeroUsize > {
102- unsupported ( )
101+ unsafe { Ok ( NonZeroUsize :: new_unchecked ( abi :: get_processor_count ( ) ) ) }
103102}
104103
105104pub mod guard {
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ impl Timespec {
4040 }
4141
4242 fn checked_add_duration ( & self , other : & Duration ) -> Option < Timespec > {
43- let mut secs = self . tv_sec . checked_add_unsigned ( other. as_secs ( ) ) ?;
43+ let mut secs = self . t . tv_sec . checked_add_unsigned ( other. as_secs ( ) ) ?;
4444
4545 // Nano calculations can't overflow because nanos are <1B which fit
4646 // in a u32.
@@ -53,7 +53,7 @@ impl Timespec {
5353 }
5454
5555 fn checked_sub_duration ( & self , other : & Duration ) -> Option < Timespec > {
56- let mut secs = self . tv_sec . checked_sub_unsigned ( other. as_secs ( ) ) ?;
56+ let mut secs = self . t . tv_sec . checked_sub_unsigned ( other. as_secs ( ) ) ?;
5757
5858 // Similar to above, nanos can't overflow.
5959 let mut nsec = self . t . tv_nsec as i32 - other. subsec_nanos ( ) as i32 ;
You can’t perform that action at this time.
0 commit comments