Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add BindgenOptions::require_syn method #2265

Merged
merged 2 commits into from
Sep 10, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 13 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,19 @@ parameters a given type uses. The analyses are defined in

The final phase is generating Rust source text from the analyzed IR, and it is
defined in `src/codegen/*`. We use the `quote` crate, which provides the `quote!
{ ... }` macro for quasi-quoting Rust forms.
{ ... }` macro for quasi-quoting Rust forms. Some options that affect the
generated Rust code are implemented using the [`syn`](https://docs.rs/syn) crate.

### Implementing new options using `syn`
pvdrz marked this conversation as resolved.
Show resolved Hide resolved

Here is a list of recommendations to be followed if a new option can be
implemented using the `syn` crate:

- The `BindgenOptions::require_syn` method must be updated to reflect that this
new option requires parsing the generated Rust code with `syn`.

- The implementation of the new option should be added at the end of
`Bindings::generate`, inside the `if options.require_syn() { ... }` block.

## Pull Requests and Code Reviews

Expand Down