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
clang::Cursor::enum_value_signed should return Option<i64> #127
Comments
Please make a comment here if you intend to work on this issue. Thank you! |
I'll take on this one. |
I'm assuming |
jcdyer
pushed a commit
to jcdyer/rust-bindgen
that referenced
this issue
Nov 6, 2016
Also reorganize calling function to avoid duplicate checking of cursor type. Fixes rust-lang#127
I took a stab at reorganizing the caller to make more fluent use of the Option, which should make things more straightforward when #128 lands. |
jcdyer
pushed a commit
to jcdyer/rust-bindgen
that referenced
this issue
Nov 6, 2016
Also reorganize calling function to avoid duplicate checking of cursor type. Fixes rust-lang#127
bors-servo
pushed a commit
that referenced
this issue
Nov 6, 2016
Wrap enum_val_signed in an Option. Also reorganize calling code to avoid duplicate checking of cursor type. Fixes #127
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Right now it always returns i64, but the FFI call it makes says
http://clang.llvm.org/doxygen/group__CINDEX__TYPES.html#ga6b8585818420e7512feb4c9d209b4f4d
We shouldn't force callers to check the kind of the cursor, we should do the check ourselves in this function and return an option. This would result in one less foot gun.
I can mentor anyone who'd like to pick up this bug.
The text was updated successfully, but these errors were encountered: