crate: string_cache_codegen v0.11
build.rs:
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:
my_atom!("unsafe extern \"C\" fn (sprite : * mut Sprite , pattern : * mut [u8 ; 8usize])")
This is error because codegen produced macro like this:
// ...
("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:
|
// Insert some newlines to make the generated code slightly easier to read. |
|
.replace(" [ \"", "[\n\"") |
|
.replace("\" , ", "\",\n") |
|
.replace(" ( \"", "\n( \"") |
|
.replace("; ", ";\n") |
crate:
string_cache_codegen v0.11build.rs:
lib.rs:
This is error because codegen produced macro like this:
This is heppening because of this:
string-cache/string-cache-codegen/lib.rs
Lines 172 to 176 in 1f420d9