Fix "can't leak crate-private type in stub.rs" #662 (#684)

First attempt to fix this issue for wasm32-unknown-* targets by
changing visibility of functions not to leak crate-private types.

Ensure the default toolchain is used for the wasm_unknown CI test.
This commit is contained in:
Ethan D Twardy 2022-05-12 07:45:47 -05:00 committed by GitHub
parent 4333e39d13
commit 7097f933eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 3 deletions

View File

@ -149,6 +149,30 @@ jobs:
RUST_VERSION: stable
WASM: wasm_emscripten
wasm_unknown:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: wasm32-unknown-unknown
override: true
default: true
- name: Build and Test
run: bash ci/github.sh
env:
RUST_VERSION: stable
WASM: wasm_unknown
cross-targets:
strategy:
matrix:

View File

@ -36,6 +36,8 @@ meaningful in the github actions feature matrix UI.
test_wasm_simple
elif [[ ${WASM:-} == wasm_emscripten ]]; then
test_wasm_emscripten
elif [[ ${WASM:-} == wasm_unknown ]]; then
test_wasm_unknown
elif [[ ${CORE:-} == no_std ]]; then
test_core
elif [[ ${EXHAUSTIVE_TZ:-} == all_tzs ]]; then
@ -118,4 +120,8 @@ test_wasm_emscripten() {
runt cargo build --target wasm32-unknown-emscripten
}
test_wasm_unknown() {
runt cargo build --target wasm32-unknown-unknown
}
main "$@"

View File

@ -65,16 +65,16 @@ fn tm_to_time(tm: &Tm) -> i64 {
+ s
}
pub fn time_to_local_tm(sec: i64, tm: &mut Tm) {
pub(super) fn time_to_local_tm(sec: i64, tm: &mut Tm) {
// FIXME: Add timezone logic
time_to_tm(sec, tm);
}
pub fn utc_tm_to_time(tm: &Tm) -> i64 {
pub(super) fn utc_tm_to_time(tm: &Tm) -> i64 {
tm_to_time(tm)
}
pub fn local_tm_to_time(tm: &Tm) -> i64 {
pub(super) fn local_tm_to_time(tm: &Tm) -> i64 {
// FIXME: Add timezone logic
tm_to_time(tm)
}