Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tokio: fix remaining issues about atomic_u64_static_once_cell.rs #5374

Merged
merged 5 commits into from
Jan 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,23 @@ jobs:
with:
toolchain: ${{ env.rust_nightly }}
components: rust-src
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
# Install linker and libraries for i686-unknown-linux-gnu
- uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: i686-unknown-linux-gnu
- run: cargo test -Zbuild-std --target target-specs/i686-unknown-linux-gnu.json -p tokio --all-features
env:
RUSTFLAGS: --cfg tokio_unstable -Dwarnings --cfg tokio_no_atomic_u64
# https://github.com/tokio-rs/tokio/pull/5356
# https://github.com/tokio-rs/tokio/issues/5373
- run: cargo hack build -p tokio --feature-powerset --depth 2 -Z avoid-dev-deps --keep-going
env:
RUSTFLAGS: --cfg tokio_unstable -Dwarnings --cfg tokio_no_atomic_u64 --cfg tokio_no_const_mutex_new
- run: cargo hack build -p tokio --feature-powerset --depth 2 -Z avoid-dev-deps --keep-going
env:
RUSTFLAGS: --cfg tokio_unstable -Dwarnings --cfg tokio_no_atomic_u64

features:
name: features
Expand Down
3 changes: 2 additions & 1 deletion tokio/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ const CONST_MUTEX_NEW_PROBE: &str = r#"
const TARGET_HAS_ATOMIC_PROBE: &str = r#"
{
#[cfg(target_has_atomic = "ptr")]
let _ = ();
let _ = ();
}
"#;

const TARGET_ATOMIC_U64_PROBE: &str = r#"
{
#[allow(unused_imports)]
use std::sync::atomic::AtomicU64 as _;
}
"#;
Expand Down
7 changes: 6 additions & 1 deletion tokio/src/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ cfg_io_driver! {
#[cfg(feature = "rt")]
pub(crate) mod atomic_cell;

#[cfg(any(feature = "rt", feature = "signal", feature = "process"))]
#[cfg(any(
feature = "rt",
feature = "signal",
feature = "process",
tokio_no_const_mutex_new,
))]
pub(crate) mod once_cell;

#[cfg(any(
Expand Down