Skip to content

Commit f49d558

Browse files
Emphasize borrowing rule in C docs (#1422)
* Emphasize borrowing rule in C docs Missing this "not" wasted an hour of my time 😅 * Use a pinned nightly --------- Co-authored-by: Alex Crichton <alex@alexcrichton.com>
1 parent 37f2b1d commit f49d558

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,11 @@ jobs:
147147
- run: cargo test -p wit-bindgen --all-features
148148
- run: cargo test -p wit-bindgen-rust
149149
- run: cargo test --workspace --exclude 'wit-bindgen*'
150-
- run: rustup update nightly --no-self-update
151-
- run: rustup component add miri --toolchain nightly
152-
- run: rustup component add rust-src --toolchain nightly
153-
- run: cargo +nightly miri test -p wit-bindgen --all-features
150+
- run: rustup update nightly-2025-11-10 --no-self-update
151+
- run: rustup default nightly-2025-11-10
152+
- run: rustup component add miri
153+
- run: rustup component add rust-src
154+
- run: cargo miri test -p wit-bindgen --all-features
154155

155156
check:
156157
name: Check

crates/c/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ The importing component's responsibility for dropping borrows of imported resour
479479
- If the borrow was passed as an argument to one of the importing component's exports:
480480
- 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
481481
- 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.
482-
- If the component obtained the borrow by calling `*_borrow*_` on an owned resource, it must not call `*_drop_borrow`
482+
- If the component obtained the borrow by calling `*_borrow*_` on an owned resource, it must **not** call `*_drop_borrow`
483483
484484
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`:
485485

0 commit comments

Comments
 (0)