Skip to content

Commit 720f0b6

Browse files
committed
Probable fix for unrepresentable concrete typedef.
1 parent 506ea0d commit 720f0b6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

engine/src/conversion/analysis/type_converter.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,10 @@ impl<'a> TypeConverter<'a> {
372372
}
373373
let (new_tn, api) = self.get_templated_typename(&Type::Path(typ))?;
374374
extra_apis.extend(api.into_iter());
375-
deps.remove(&tn);
375+
// Although it's tempting to remove the dep on the original type,
376+
// this means we wouldn't spot cases where the original type can't
377+
// be represented in C++, e.g. because it has an unused template parameter.
378+
// So we keep the original dep too.
376379
typ = new_tn.to_type_path();
377380
deps.insert(new_tn);
378381
}

engine/src/conversion/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl<'a> BridgeConverter<'a> {
120120
Self::dump_apis("parsing", &apis);
121121
// Inside parse_results, we now have a list of APIs.
122122
// We now enter various analysis phases.
123-
// Next, convert any typedefs.
123+
// First, convert any typedefs.
124124
// "Convert" means replacing bindgen-style type targets
125125
// (e.g. root::std::unique_ptr) with cxx-style targets (e.g. UniquePtr).
126126
let apis = convert_typedef_targets(self.config, apis);

0 commit comments

Comments
 (0)