-
Notifications
You must be signed in to change notification settings - Fork 743
Comments are copied verbatim without checking if they might be invalid #426
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
Comments
Oh, that sucks, is it really a parse error? cc rust-lang/rust#38825 and #378. |
It seems we need to process comments no matter what, sigh. |
I think it shouldn't be that hard. If the comment is C-style and the first character is |
I'm having this issue as well. This seems like it should be very common, since there are a lot of libraries with Doxygen comments. Is there at least a way to turn off the copying of comments? What if I don't need annotations? At the very least, what @jethrogb suggested would at least let me use bindgen. Everything else about the bindings is great! EDIT: the specific header I'm having issues with: https://github.com/opensource-apple/CF/blob/master/CFArray.h#L28 |
It looks like we need to fix this here, based on the following discussion of these kinds of errors: |
This is mostly a work around rust-lang#426, until we implement the proper fix.
I'm landing a workaround in #444, since I don't have the time to write the proper fix right now. This should allow people to keep using bindgen meanwhile. |
This is mostly a work around rust-lang#426, until we implement the proper fix.
Same issue when building FAST error: Could not compile To learn more, run the command again with --verbose. |
@mattmacy assuming since you're running |
@Snewt yes, I got past that point by doing so |
A related issue is that sometimes comments aren't actually doc comments, like with this sort of pattern:
|
With this change, we can correctly parse C++ block comments. ``` /** * Does a thing * * More documentation. This test does something * useful. */ ``` into ``` /// Does a thing /// /// More documentation. This test does something /// useful. ``` Fixes rust-lang#426.
With this change, we can correctly parse C++ block comments. ``` /** * Does a thing * * More documentation. This test does something * useful. */ ``` into ``` /// Does a thing /// /// More documentation. This test does something /// useful. ``` Fixes rust-lang#426.
With this change, we can correctly parse C++ block comments. ``` /** * Does a thing * * More documentation. This test does something * useful. */ ``` into ``` /// Does a thing /// /// More documentation. This test does something /// useful. ``` Fixes rust-lang#426.
With this change, we can correctly parse C++ block comments. ``` /** * Does a thing * * More documentation. This test does something * useful. */ ``` into ``` /// Does a thing /// /// More documentation. This test does something /// useful. ``` Fixes rust-lang#426.
With this change, we can correctly parse C++ block comments. ``` /** * Does a thing * * More documentation. This test does something * useful. */ ``` into ``` /// Does a thing /// /// More documentation. This test does something /// useful. ``` Fixes rust-lang#426.
With this change, we can correctly parse C++ block comments. ``` /** * Does a thing * * More documentation. This test does something * useful. */ ``` into ``` /// Does a thing /// /// More documentation. This test does something /// useful. ``` Fixes rust-lang#426.
With this change, we can correctly parse C++ block comments. ``` /** * Does a thing * * More documentation. This test does something * useful. */ ``` into ``` /// Does a thing /// /// More documentation. This test does something /// useful. ``` Fixes rust-lang#426.
With this change, we can correctly parse C++ block comments. ``` /** * Does a thing * * More documentation. This test does something * useful. */ ``` into ``` /// Does a thing /// /// More documentation. This test does something /// useful. ``` Fixes rust-lang#426.
With this change, we can correctly parse C++ block comments. ``` /** * Does a thing * * More documentation. This test does something * useful. */ ``` into ``` /// Does a thing /// /// More documentation. This test does something /// useful. ``` Fixes rust-lang#426.
Intelligently convert C/C++ comments to Rust With this change, we can correctly parse C++ block comments. ```cpp /** * Does a thing * * More documentation. This test does something * useful. */ ``` into ```rust /// Does a thing /// /// More documentation. This test does something /// useful. ``` Fixes #426.
Fixes bindgen errors due to invalid Rust comments imported from functions `ncmultiselector_options` and `ncselector_item`. Related: - rust-lang/rust-bindgen#426 - rust-lang/rust-bindgen#1749
Fixes bindgen errors due to invalid Rust comments imported from functions `ncmultiselector_options` and `ncselector_item`. Related: - rust-lang/rust-bindgen#426 - rust-lang/rust-bindgen#1749
C and Rust comments are not the same. bindgen copies comments verbatim anyway, and this breaks things.
For example, here's an excerpt from a real-life header I was using with bindgen 0.19:
bindgen 0.20 output for this type is:
which rustc does not like:
The text was updated successfully, but these errors were encountered: