-
Notifications
You must be signed in to change notification settings - Fork 721
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
C javadoc comments are not Markdown-escaped, triggering rustdoc
warnings
#2057
Comments
This is #1313 basically... I suspect the best path forward here is probably making sure we treat all doc comments as literal blocks of code (basically prepending triple-quotes or something) so that we don't mess up whitespace and other things people do on doc comments. There's some other discussion about this somewhere else, IIRC. |
#2347 could provide a solution for this. |
It would be nice to still offer the original behavior, in case a library is bindgenned which uses Markdown comments. |
now that #2347 landed. This can be solved by implementing #[derive(Debug)]
struct Cb;
impl ParseCallbacks for Cb {
fn process_comment(&self, comment: &str) -> Option<String> {
Some(format!("````\n{}\n````", comment))
}
} or parsing it with a javadoc parser (not sure if such thing exists in Rust) |
This comes up in Rust for Linux when generating the bindings for some C APIs that happen to have javadoc-like comments that end up being broken Markdown: Rust-for-Linux/linux#323.
Input C/C++ Header
Bindgen Invocation
Actual Results
Which leads to
rustdoc
warnings such as:Expected Results
The text was updated successfully, but these errors were encountered: