From 1830b38012c4b6674458b63f384bd549fcb52470 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 27 Oct 2022 00:20:38 +0000 Subject: [PATCH] Handle path types that start with `crate::` --- c-bindings-gen/src/types.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/c-bindings-gen/src/types.rs b/c-bindings-gen/src/types.rs index ecc508d..9462e98 100644 --- a/c-bindings-gen/src/types.rs +++ b/c-bindings-gen/src/types.rs @@ -650,6 +650,8 @@ impl<'mod_lifetime, 'crate_lft: 'mod_lifetime> ImportResolver<'mod_lifetime, 'cr Some(format!("{}::{}{}", self.module_path, first_seg.ident, remaining)) } else if first_seg_is_stdlib(&first_seg_str) || self.dependencies.contains(&first_seg.ident) { Some(first_seg_str + &remaining) + } else if first_seg_str == "crate" { + Some(self.crate_name.to_owned() + &remaining) } else { None } } } -- 2.39.5