-
Notifications
You must be signed in to change notification settings - Fork 745
clang::Cursor::referenced should return Option<clang::Cursor> #232
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::referenced should return Option<clang::Cursor> #232
Conversation
@@ -612,7 +612,7 @@ impl Type { | |||
TypeKind::TemplateAlias(inner.unwrap(), args) | |||
} | |||
CXCursor_TemplateRef => { | |||
let referenced = location.referenced(); | |||
let referenced = location.referenced().unwrap_or(location); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably expect
the method to return a Cursor
, so that we'll know when this doesn't return one (ditto below on the same).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we should use either unwrap
or expect, if the cursor here is invalid, it's probably a bug. If it isn't, then we can return early an Err
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. I changed unwrap_or
to expect
.
Please claim the relevant issue before working on it, so that we can reduce duplicate efforts :) Also, the merge commits should be removed. |
Sorry, I remove merge commits. |
058d55c
to
76b5372
Compare
@bors-servo r+ Thanks! |
📌 Commit 76b5372 has been approved by |
⚡ Test exempted - status |
…rsor, r=emilio clang::Cursor::referenced should return Option<clang::Cursor> Fixes #124 Since I am new to Rust, I hope I didn't do things too badly
…ng#232) We use the kind for the sign and the layout's size for the width, and we wrap unsigned values that are too large to fit inside the determined type.
Fixes #124
Since I am new to Rust, I hope I didn't do things too badly