Skip to content

Commit

Permalink
Probable fix for unrepresentable concrete typedef.
Browse files Browse the repository at this point in the history
  • Loading branch information
adetaylor committed Jan 8, 2025
1 parent 506ea0d commit 720f0b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion engine/src/conversion/analysis/type_converter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,10 @@ impl<'a> TypeConverter<'a> {
}
let (new_tn, api) = self.get_templated_typename(&Type::Path(typ))?;
extra_apis.extend(api.into_iter());
deps.remove(&tn);
// Although it's tempting to remove the dep on the original type,
// this means we wouldn't spot cases where the original type can't
// be represented in C++, e.g. because it has an unused template parameter.
// So we keep the original dep too.
typ = new_tn.to_type_path();
deps.insert(new_tn);
}
Expand Down
2 changes: 1 addition & 1 deletion engine/src/conversion/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ impl<'a> BridgeConverter<'a> {
Self::dump_apis("parsing", &apis);
// Inside parse_results, we now have a list of APIs.
// We now enter various analysis phases.
// Next, convert any typedefs.
// First, convert any typedefs.
// "Convert" means replacing bindgen-style type targets
// (e.g. root::std::unique_ptr) with cxx-style targets (e.g. UniquePtr).
let apis = convert_typedef_targets(self.config, apis);
Expand Down

0 comments on commit 720f0b6

Please sign in to comment.