-
Notifications
You must be signed in to change notification settings - Fork 698
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
ir: When something has a definition, return unresolved type references until we parse it. #926
Conversation
r? @fitzgen |
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.
Everything makes sense and seems good to me, except that A_C
-> C
change, which I think needs to be fixed.
src/ir/item.rs
Outdated
let definition = cursor.definition(); | ||
let applicable_cursor = definition.unwrap_or(cursor); | ||
|
||
if definition.is_some() && definition != Some(cursor) { |
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.
Care to plop the commit message as a comment right here? I think that would help future readers of this code.
@@ -73,6 +53,26 @@ fn bindgen_test_layout_A() { | |||
impl Clone for A { | |||
fn clone(&self) -> Self { *self } | |||
} | |||
#[repr(C)] | |||
#[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] | |||
pub struct C { |
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 still be A_C
though, shouldn't it? I don't think this change is desirable.
class A {
public:
int member_a;
class B {
int member_b;
};
class C;
template<typename T>
class D {
T foo;
};
};
class A::C {
int baz;
};
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.
Good catch here, thanks! I'll take a look tomorrow when I have the time.
…s until we parse it. This ensures that we see all the relevant types that are defined when parsing the definition, avoiding problems like rust-lang#888. Fixes rust-lang#888
I fixed that bit, can you re-review @fitzgen? |
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.
👍
@bors-servo r+ |
📌 Commit 8ecb50a has been approved by |
ir: When something has a definition, return unresolved type references until we parse it. This fixes #888
☀️ Test successful - status-travis |
This fixes #888