File tree Expand file tree Collapse file tree 2 files changed +25
-4
lines changed Expand file tree Collapse file tree 2 files changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,8 @@ sparc64-unknown-linux-gnu \
9595sparcv9-sun-solaris \
9696wasm32-unknown-emscripten \
9797wasm32-unknown-unknown \
98+ wasm32-wasip1 \
99+ wasm32-wasip2 \
98100x86_64-linux-android \
99101x86_64-unknown-freebsd \
100102x86_64-unknown-linux-gnu \
@@ -227,12 +229,29 @@ else
227229 no_dist_targets=" "
228230fi
229231
232+ case " $rust " in
233+ " stable" ) supports_wasi_pn=1 ;;
234+ " beta" ) supports_wasi_pn=1 ;;
235+ " nightly" ) supports_wasi_pn=1 ;;
236+ * ) supports_wasi_pn=0 ;;
237+ esac
238+
230239for target in $targets ; do
231240 if echo " $target " | grep -q " $filter " ; then
232241 if [ " $os " = " windows" ]; then
233242 TARGET=" $target " ./ci/install-rust.sh
234243 test_target " $target "
235244 else
245+ # `wasm32-wasip1` was renamed from `wasm32-wasi`
246+ if [ " $target " = " wasm32-wasip1" ] && [ " $supports_wasi_pn " = " 0" ]; then
247+ target=" wasm32-wasi"
248+ fi
249+
250+ # `wasm32-wasip2` only exists in recent versions of Rust
251+ if [ " $target " = " wasm32-wasip2" ] && [ " $supports_wasi_pn " = " 0" ]; then
252+ continue
253+ fi
254+
236255 test_target " $target "
237256 fi
238257
Original file line number Diff line number Diff line change @@ -384,15 +384,17 @@ cfg_if! {
384384 } else {
385385 // unsafe code here is required in the stable, but not in nightly
386386 #[ allow( unused_unsafe) ]
387- pub static CLOCK_MONOTONIC : clockid_t = clockid_t( core:: ptr:: addr_of!( _CLOCK_MONOTONIC) ) ;
387+ pub static CLOCK_MONOTONIC : clockid_t =
388+ unsafe { clockid_t( core:: ptr:: addr_of!( _CLOCK_MONOTONIC) ) } ;
388389 #[ allow( unused_unsafe) ]
389390 pub static CLOCK_PROCESS_CPUTIME_ID : clockid_t =
390- clockid_t( core:: ptr:: addr_of!( _CLOCK_PROCESS_CPUTIME_ID) ) ;
391+ unsafe { clockid_t( core:: ptr:: addr_of!( _CLOCK_PROCESS_CPUTIME_ID) ) } ;
391392 #[ allow( unused_unsafe) ]
392- pub static CLOCK_REALTIME : clockid_t = clockid_t( core:: ptr:: addr_of!( _CLOCK_REALTIME) ) ;
393+ pub static CLOCK_REALTIME : clockid_t =
394+ unsafe { clockid_t( core:: ptr:: addr_of!( _CLOCK_REALTIME) ) } ;
393395 #[ allow( unused_unsafe) ]
394396 pub static CLOCK_THREAD_CPUTIME_ID : clockid_t =
395- clockid_t( core:: ptr:: addr_of!( _CLOCK_THREAD_CPUTIME_ID) ) ;
397+ unsafe { clockid_t( core:: ptr:: addr_of!( _CLOCK_THREAD_CPUTIME_ID) ) } ;
396398 }
397399}
398400
You can’t perform that action at this time.
0 commit comments