Skip to content

Commit 2aeac0f

Browse files
committed
Run Miri on CI
1 parent cb0f36f commit 2aeac0f

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,18 @@ jobs:
6868
run: rustup update stable
6969
- run: cargo fmt --all -- --check
7070

71+
miri:
72+
runs-on: ubuntu-latest
73+
steps:
74+
- uses: actions/checkout@v3
75+
- name: Install Rust
76+
run: rustup toolchain install nightly --component miri && rustup default nightly
77+
- run: cargo miri test
78+
env:
79+
# -Zmiri-ignore-leaks is needed because we use detached threads in doctests
80+
MIRIFLAGS: -Zmiri-strict-provenance -Zmiri-symbolic-alignment-check -Zmiri-disable-isolation -Zmiri-ignore-leaks
81+
RUSTFLAGS: ${{ env.RUSTFLAGS }} -Z randomize-layout
82+
7183
security_audit:
7284
runs-on: ubuntu-latest
7385
steps:

src/task.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ impl<T> Task<T> {
9999
/// # Examples
100100
///
101101
/// ```
102+
/// # if cfg!(miri) { return; } // Miri does not support epoll
102103
/// use smol::{future, Executor, Timer};
103104
/// use std::thread;
104105
/// use std::time::Duration;
@@ -485,6 +486,7 @@ impl<T> FallibleTask<T> {
485486
/// # Examples
486487
///
487488
/// ```
489+
/// # if cfg!(miri) { return; } // Miri does not support epoll
488490
/// use smol::{future, Executor, Timer};
489491
/// use std::thread;
490492
/// use std::time::Duration;

0 commit comments

Comments
 (0)