diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c42dd3af4..29d22b10e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -147,10 +147,11 @@ jobs: - run: cargo test -p wit-bindgen --all-features - run: cargo test -p wit-bindgen-rust - run: cargo test --workspace --exclude 'wit-bindgen*' - - run: rustup update nightly --no-self-update - - run: rustup component add miri --toolchain nightly - - run: rustup component add rust-src --toolchain nightly - - run: cargo +nightly miri test -p wit-bindgen --all-features + - run: rustup update nightly-2025-11-10 --no-self-update + - run: rustup default nightly-2025-11-10 + - run: rustup component add miri + - run: rustup component add rust-src + - run: cargo miri test -p wit-bindgen --all-features check: name: Check diff --git a/crates/c/README.md b/crates/c/README.md index c0a9772f7..522f90e8b 100644 --- a/crates/c/README.md +++ b/crates/c/README.md @@ -479,7 +479,7 @@ The importing component's responsibility for dropping borrows of imported resour - If the borrow was passed as an argument to one of the importing component's exports: - If the bindings were generated with `--autodrop-borrows=yes`, then borrowed handles will be automatically dropped when the exported function returns; no additional action is required by importing component - If the bindings were generated with `--autodrop-borrow=no`, or this command line option was not supplied, then the importing component must drop the borrowed handle by calling the generated `*_drop_borrow` function. -- If the component obtained the borrow by calling `*_borrow*_` on an owned resource, it must not call `*_drop_borrow` +- If the component obtained the borrow by calling `*_borrow*_` on an owned resource, it must **not** call `*_drop_borrow` Here is a potential implementation of the `run` export that correctly handles the lifetime of the owned cat resource retrieved from `get-cat-by-name`: