summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zenoh-bridge-dds.spec5
1 files changed, 4 insertions, 1 deletions
diff --git a/zenoh-bridge-dds.spec b/zenoh-bridge-dds.spec
index ebb453e..13f9a7c 100644
--- a/zenoh-bridge-dds.spec
+++ b/zenoh-bridge-dds.spec
@@ -39,12 +39,15 @@ tar -xzf %{SOURCE1}
# Patch bindgen 0.58.1: sanitize_name only replaces space/colon/dot, not
# parentheses and slashes in unnamed enum type names from newer glibc headers
# (e.g. confname.h), causing proc-macro2 panic "is not a valid Ident".
+# Replace ALL non-identifier chars with "_" — use |c: char| explicit type
+# annotation to avoid Rust E0282 "type annotations needed" (str::replace
+# Pattern trait resolution ambiguity without explicit char type on closure).
python3 - <<'PYEOF'
import json, hashlib
p = 'vendor/bindgen/src/ir/ty.rs'
s = open(p).read()
old = "name.replace(|c| c == ' ' || c == ':' || c == '.', \"_\")"
-new = "name.replace(|c| !(c.is_alphanumeric() || c == '_'), \"_\")"
+new = "name.replace(|c: char| !(c.is_alphanumeric() || c == '_'), \"_\")"
assert old in s, "bindgen sanitize_name pattern not found"
s = s.replace(old, new)
open(p, 'w').write(s)