File tree 4 files changed +10
-11
lines changed
4 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -1529,9 +1529,9 @@ dependencies = [
1529
1529
1530
1530
[[package ]]
1531
1531
name = " hermit-abi"
1532
- version = " 0.3.1 "
1532
+ version = " 0.3.2 "
1533
1533
source = " registry+https://github.com/rust-lang/crates.io-index"
1534
- checksum = " fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286 "
1534
+ checksum = " 443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b "
1535
1535
dependencies = [
1536
1536
" compiler_builtins" ,
1537
1537
" rustc-std-workspace-alloc" ,
@@ -1864,7 +1864,7 @@ version = "1.0.11"
1864
1864
source = " registry+https://github.com/rust-lang/crates.io-index"
1865
1865
checksum = " eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2"
1866
1866
dependencies = [
1867
- " hermit-abi 0.3.1 " ,
1867
+ " hermit-abi 0.3.2 " ,
1868
1868
" libc" ,
1869
1869
" windows-sys 0.48.0" ,
1870
1870
]
@@ -1881,7 +1881,7 @@ version = "0.4.8"
1881
1881
source = " registry+https://github.com/rust-lang/crates.io-index"
1882
1882
checksum = " 24fddda5af7e54bf7da53067d6e802dbcc381d0a8eef629df528e3ebf68755cb"
1883
1883
dependencies = [
1884
- " hermit-abi 0.3.1 " ,
1884
+ " hermit-abi 0.3.2 " ,
1885
1885
" rustix 0.38.2" ,
1886
1886
" windows-sys 0.48.0" ,
1887
1887
]
@@ -2396,7 +2396,7 @@ version = "1.16.0"
2396
2396
source = " registry+https://github.com/rust-lang/crates.io-index"
2397
2397
checksum = " 4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43"
2398
2398
dependencies = [
2399
- " hermit-abi 0.3.1 " ,
2399
+ " hermit-abi 0.3.2 " ,
2400
2400
" libc" ,
2401
2401
]
2402
2402
@@ -4819,7 +4819,7 @@ dependencies = [
4819
4819
" dlmalloc" ,
4820
4820
" fortanix-sgx-abi" ,
4821
4821
" hashbrown 0.14.0" ,
4822
- " hermit-abi 0.3.1 " ,
4822
+ " hermit-abi 0.3.2 " ,
4823
4823
" libc" ,
4824
4824
" miniz_oxide" ,
4825
4825
" 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'] }
45
45
fortanix-sgx-abi = { version = " 0.5.0" , features = [' rustc-dep-of-std' ], public = true }
46
46
47
47
[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 }
49
49
50
50
[target .wasm32-wasi .dependencies ]
51
51
wasi = { version = " 0.11.0" , features = [' rustc-dep-of-std' ], default-features = false }
Original file line number Diff line number Diff line change 1
1
#![ allow( dead_code) ]
2
2
3
- use super :: unsupported;
4
3
use crate :: ffi:: CStr ;
5
4
use crate :: io;
6
5
use crate :: mem;
@@ -99,7 +98,7 @@ impl Thread {
99
98
}
100
99
101
100
pub fn available_parallelism ( ) -> io:: Result < NonZeroUsize > {
102
- unsupported ( )
101
+ unsafe { Ok ( NonZeroUsize :: new_unchecked ( abi :: get_processor_count ( ) ) ) }
103
102
}
104
103
105
104
pub mod guard {
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ impl Timespec {
40
40
}
41
41
42
42
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 ( ) ) ?;
44
44
45
45
// Nano calculations can't overflow because nanos are <1B which fit
46
46
// in a u32.
@@ -53,7 +53,7 @@ impl Timespec {
53
53
}
54
54
55
55
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 ( ) ) ?;
57
57
58
58
// Similar to above, nanos can't overflow.
59
59
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