Skip to content

Commit 87b4968

Browse files
committed
Handle type references which refer to a module defined in scope
eg ``` mod module; fn a() -> module::Type { todo!() } ```
1 parent 9d79103 commit 87b4968

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

c-bindings-gen/src/types.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,8 @@ impl<'mod_lifetime, 'crate_lft: 'mod_lifetime> ImportResolver<'mod_lifetime, 'cr
679679
Some(first_seg_str + &remaining)
680680
} else if first_seg_str == "crate" {
681681
Some(self.crate_name.to_owned() + &remaining)
682+
} else if self.library.modules.get(&format!("{}::{}", self.module_path, first_seg.ident)).is_some() {
683+
Some(format!("{}::{}{}", self.module_path, first_seg.ident, remaining))
682684
} else { None }
683685
}
684686
}

0 commit comments

Comments
 (0)