Skip to content

Commit 32b5973

Browse files
committed
Fix declaration_generics in PointeeTy::CFTypeDef
The typedef name was replaced by replace_typedef_name right before.
1 parent 75419b2 commit 32b5973

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

crates/header-translator/src/rust_type.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,17 +1583,18 @@ impl Ty {
15831583
if pointee
15841584
.is_direct_cf_type(&id.name, bridged_to(&declaration, context).is_some())
15851585
{
1586-
// A bit annoying that we replace the typedef name
1587-
// here, as that's also what determines whether the
1588-
// type is a CF type or not... But that's how it is
1589-
// currently.
1590-
let id = context.replace_typedef_name(id, true);
15911586
let declaration_generics = context
15921587
.library(&id)
15931588
.typedef_data
15941589
.get(&id.name)
15951590
.map(|data| data.generics.clone())
15961591
.unwrap_or_default();
1592+
1593+
// A bit annoying that we replace the typedef name
1594+
// here, as that's also what determines whether the
1595+
// type is a CF type or not... But that's how it is
1596+
// currently.
1597+
let id = context.replace_typedef_name(id, true);
15971598
*pointee = Box::new(Self::Pointee(PointeeTy::CFTypeDef {
15981599
id,
15991600
declaration_generics,

0 commit comments

Comments
 (0)