1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! Bind a trait-bridge registry fixture to the C ABI symbol the FFI backend really exports.
//!
//! `src/backends/ffi/trait_bridge/registration.rs` derives `{prefix}_unregister_{trait_snake}`
//! and `{prefix}_clear_{trait_snake}` from the bridge's trait name and discards the
//! `unregister_fn`/`clear_fn` config text's spelling, so a crate that names
//! `clear_fn = "clear_ocr_backends"` on a trait `OcrBackend` ships `..._clear_ocr_backend`.
//! `recipe::trait_bridge_derived_c_identity` is where that derivation is re-stated for
//! consumers; this module is what makes the C emitter obey it.
use ResolvedCallInfo;
use crateCallConfig;
use crateTraitBridgeRegistryOperation;
/// Overwrite `info`'s function name (and, for `unregister`/`clear`, its out-param) with the
/// derived C ABI identity.
///
/// The derived identity is what the FFI backend exports, so the only config that may outrank
/// it is the one statement that is *about* C: `overrides.c.function`. The base
/// `[crates.e2e.calls.*] function` is the Rust core's name, shared by every language, and a
/// well-formed config populates it -- gating this on `info.function_name` being empty
/// therefore let the Rust spelling shadow the ABI truth for every properly configured
/// registry fixture, emitting a symbol the generated header never declares. ~keep
pub