From cd719383b7da4781c0e7d3f9d9d4ef418ef27749 Mon Sep 17 00:00:00 2001 From: Luke Yeager Date: Fri, 24 Jul 2020 15:01:05 -0700 Subject: [PATCH] Update c-with-rust.md Add the `--use-core` flag for folks using the bindgen binary --- src/interoperability/c-with-rust.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interoperability/c-with-rust.md b/src/interoperability/c-with-rust.md index ab065190..2d3f3778 100644 --- a/src/interoperability/c-with-rust.md +++ b/src/interoperability/c-with-rust.md @@ -84,7 +84,7 @@ Rather than manually generating these interfaces, which may be tedious and error 2. Write a `bindings.h` file, which `#include "..."`'s each of the files you gathered in step one 3. Feed this `bindings.h` file, along with any compilation flags used to compile your code into `bindgen`. Tip: use `Builder.ctypes_prefix("cty")` / - `--ctypes-prefix=cty` and `Builder.use_core()` to make the generated code `#![no_std]` compatible. + `--ctypes-prefix=cty` and `Builder.use_core()` / `--use-core` to make the generated code `#![no_std]` compatible. 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`. [bindgen]: https://github.com/rust-lang/rust-bindgen