Skip to content

Commit b525644

Browse files
Merge #256
256: Update c-with-rust.md r=adamgreig a=lukeyeager Add the `--use-core` flag for folks using the bindgen binary Co-authored-by: Luke Yeager <lukeyeager@users.noreply.github.com>
2 parents 94d9ea8 + cd71938 commit b525644

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/interoperability/c-with-rust.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Rather than manually generating these interfaces, which may be tedious and error
8484
2. Write a `bindings.h` file, which `#include "..."`'s each of the files you gathered in step one
8585
3. Feed this `bindings.h` file, along with any compilation flags used to compile
8686
your code into `bindgen`. Tip: use `Builder.ctypes_prefix("cty")` /
87-
`--ctypes-prefix=cty` and `Builder.use_core()` to make the generated code `#![no_std]` compatible.
87+
`--ctypes-prefix=cty` and `Builder.use_core()` / `--use-core` to make the generated code `#![no_std]` compatible.
8888
4. `bindgen` will produce the generated Rust code to the output of the terminal window. This file may be piped to a file in your project, such as `bindings.rs`. You may use this file in your Rust project to interact with C/C++ code compiled and linked as an external library. Tip: don't forget to use the [`cty`](https://crates.io/crates/cty) crate if your types in the generated bindings are prefixed with `cty`.
8989

9090
[bindgen]: https://github.com/rust-lang/rust-bindgen

0 commit comments

Comments
 (0)