crate: `string_cache_codegen v0.11` build.rs: ```rust let mut cache = string_cache_codegen::AtomType::new("my:BundledApiAtom", "my_atom!"); cache.atom("unsafe extern \"C\" fn (sprite : * mut Sprite , pattern : * mut [u8 ; 8usize])"); ``` lib.rs: ```rust my_atom!("unsafe extern \"C\" fn (sprite : * mut Sprite , pattern : * mut [u8 ; 8usize])") ``` This is error because codegen produced macro like this: ```rust // ... ("unsafe extern \"C\" fn (sprite : * mut Sprite , pattern : * mut [u8 ; 8usize])") => { $ crate :: my :: ATOM_BUNDLEDAPIATOM__75_6E_73_61_66_65_20_65_78_74_65_72_6E_20_22_43_22_20_66_6E_20_28_73_70_72_69_74_65_20_3A_20_2A_20_6D_75_74_20_53_70_72_69_74_65_20_2C_20_70_61_74_74_65_72_6E_20_3A_20_2A_20_6D_75_74_20_5B_75_38_20_3B_20_38_75_73_69_7A_65_5D_29 } ; // ... ``` This is heppening because of this: https://github.com/servo/string-cache/blob/1f420d95e74fd2d39a3bd3a82f23a441fed8f14d/string-cache-codegen/lib.rs#L172-L176
Activity
fix servo#311, codegen produces incorrect pattern for macro, broken u…
SimonSapin commentedon Sep 14, 2026
Should be fixed in https://crates.io/crates/string_cache_codegen/0.11.2