Skip to content

Commit 8b29355

Browse files
pvdrzkulp
authored andcommitted
document usage of syn in CONTRIBUTING.md
1 parent 7464da3 commit 8b29355

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

CONTRIBUTING.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,19 @@ parameters a given type uses. The analyses are defined in
318318

319319
The final phase is generating Rust source text from the analyzed IR, and it is
320320
defined in `src/codegen/*`. We use the `quote` crate, which provides the `quote!
321-
{ ... }` macro for quasi-quoting Rust forms.
321+
{ ... }` macro for quasi-quoting Rust forms. Some options that affect the
322+
generated Rust code are implemented using the [`syn`](https://docs.rs/syn) crate.
323+
324+
### Implementing new options using `syn`
325+
326+
Here is a list of recommendations to be followed if a new option can be
327+
implemented using the `syn` crate:
328+
329+
- The `BindgenOptions::require_syn` method must be updated to reflect that this
330+
new option requires parsing the generated Rust code with `syn`.
331+
332+
- The implementation of the new option should be added at the end of
333+
`Bindings::generate`, inside the `if options.require_syn() { ... }` block.
322334

323335
## Pull Requests and Code Reviews
324336

0 commit comments

Comments
 (0)