Skip to content

clang::Type::elem_type should return Option<Type> #138

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

Closed
fitzgen opened this issue Oct 25, 2016 · 3 comments
Closed

clang::Type::elem_type should return Option<Type> #138

fitzgen opened this issue Oct 25, 2016 · 3 comments

Comments

@fitzgen
Copy link
Member

fitzgen commented Oct 25, 2016

We make this FFI call:

http://clang.llvm.org/doxygen/group__CINDEX__TYPES.html#gab35027c8bc48fab25f7698a415c93922

If a type is passed in that is not an array, complex, or vector type, an invalid type is returned.

We should check for an invalid type result and return None, otherwise Some.

This change means that every caller won't have to do this check themselves, which is one less foot gun.

i can mentor whoever works on this bug.

@highfive
Copy link

Please make a comment here if you intend to work on this issue. Thank you!

@Incognitas
Copy link

I can work on this one.

@fitzgen
Copy link
Member Author

fitzgen commented Oct 31, 2016

Great! Let me know if you have any questions or run into any road blocks :)

bors-servo pushed a commit that referenced this issue Nov 1, 2016
Fix for #138 : rework for elem_type() which now returns Option<Type> instead of Type

Fixes #138
Since I am new to Rust, I hope I didn't do things too badly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants