Skip to content

Commit a851305

Browse files
committed
ir: When something has a definition, return unresolved type references until we parse it.
Fixes rust-lang#888
1 parent 978b531 commit a851305

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/ir/item.rs

+12-1
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,18 @@ impl ClangItemParser for Item {
11941194
// Types are sort of special, so to avoid parsing template classes
11951195
// twice, handle them separately.
11961196
{
1197-
let applicable_cursor = cursor.definition().unwrap_or(cursor);
1197+
let definition = cursor.definition();
1198+
let applicable_cursor = definition.unwrap_or(cursor);
1199+
1200+
if definition.is_some() && definition != Some(cursor) {
1201+
return Ok(Item::from_ty_or_ref(
1202+
applicable_cursor.cur_type(),
1203+
cursor,
1204+
parent_id,
1205+
ctx,
1206+
));
1207+
}
1208+
11981209
match Item::from_ty(
11991210
&applicable_cursor.cur_type(),
12001211
applicable_cursor,

0 commit comments

Comments
 (0)