Skip to content

Generator docs: add note about clang documentation string options + minor tweaks #1764

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

Merged
merged 3 commits into from
Apr 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -712,14 +712,21 @@ impl Builder {
self
}

/// Whether the generated bindings should contain documentation comments or
/// not.
/// Whether the generated bindings should contain documentation comments
/// (docstrings) or not.
///
/// This ideally will always be true, but it may need to be false until we
/// implement some processing on comments to work around issues as described
/// in:
/// in [rust-bindgen issue
/// #426](https://github.com/rust-lang/rust-bindgen/issues/426).
///
/// https://github.com/rust-lang/rust-bindgen/issues/426
/// Note that clang by default excludes comments from system headers, pass
/// `-fretain-comments-from-system-headers` as
/// [`clang_arg`][Builder::clang_arg] to include them. It can also be told
/// to process all comments (not just documentation ones) using the
/// `-fparse-all-comments` flag. See [slides on clang comment parsing](
/// https://llvm.org/devmtg/2012-11/Gribenko_CommentParsing.pdf) for
/// background and examples.
pub fn generate_comments(mut self, doit: bool) -> Self {
self.options.generate_comments = doit;
self
Expand Down