diff --git a/README.md b/README.md index 885fe7f90c..c19f947359 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,10 @@ crate-type = [ # such as integration `tests/`, doctests, and `examples/` ] +[[bin]] +name = "generate-headers" +required-features = ["headers"] # Do not build unless generating headers. + [dependencies] # Use `cargo add` or `cargo search` to find the latest values of x.y.z. # For instance: diff --git a/guide/src/introduction/quickstart.md b/guide/src/introduction/quickstart.md index 66a66eb0e7..97f228f6d1 100644 --- a/guide/src/introduction/quickstart.md +++ b/guide/src/introduction/quickstart.md @@ -32,6 +32,10 @@ crate-type = [ "lib", # For `generate-headers`, `examples/`, `tests/` etc. ] +[[bin]] +name = "generate-headers" +required-features = ["headers"] # Do not build unless generating headers. + [dependencies] # Use `cargo add` or `cargo search` to find the latest values of x.y.z. # For instance: diff --git a/guide/src/usage/lib-rs.md b/guide/src/usage/lib-rs.md index c96d5008bf..184d77a700 100644 --- a/guide/src/usage/lib-rs.md +++ b/guide/src/usage/lib-rs.md @@ -81,18 +81,6 @@ file(name), or into the given `Write`-able / "write sink": to generate the headers. - - You may also want to add: - - ```toml - # Cargo.toml - [[bin]] - name = "generate-headers" - required-features = ["headers"] - ``` - - to your `Cargo.toml` to improve the error messages when the feature is - missing. -
More advanced example (runtime-dependent header output)