Skip to content

Commit

Permalink
ir: When something has a definition, return unresolved type reference…
Browse files Browse the repository at this point in the history
…s until we parse it.

Fixes rust-lang#888
  • Loading branch information
emilio committed Aug 23, 2017
1 parent 978b531 commit a851305
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/ir/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,18 @@ impl ClangItemParser for Item {
// Types are sort of special, so to avoid parsing template classes
// twice, handle them separately.
{
let applicable_cursor = cursor.definition().unwrap_or(cursor);
let definition = cursor.definition();
let applicable_cursor = definition.unwrap_or(cursor);

if definition.is_some() && definition != Some(cursor) {
return Ok(Item::from_ty_or_ref(
applicable_cursor.cur_type(),
cursor,
parent_id,
ctx,
));
}

match Item::from_ty(
&applicable_cursor.cur_type(),
applicable_cursor,
Expand Down

0 comments on commit a851305

Please sign in to comment.