In traits with associated types which are returned in generics (ie
`trait T { type A: B; fn c() -> Result<Self::A, ()> {} }`), we
created a new generic mapping with the local type name (in this
case A) instead of using the real type (in this case B). This is
confusing as it results in generic manglings that don't reference
the real type (eg `LDKCResult_ChanKeySignerDecodeErrorZ`) and
may have multiple generic definitions that are identical.
Instead, we now use the final ident in the resolved mapping. The
biggest win is `LDKCResult_ChanKeySignerDecodeErrorZ` changing to
`CResult_ChannelKeysDecodeErrorZ`. However, there are several types
where `secp256k1::Error` was imported as `SecpError` and types like
`LDKCResult_SecretKeySecpErrorZ` are now
`LDKCResult_SecretKeyErrorZ` instead. Still, the type of the error
field remains `LDKSecp256k1Error`, which should avoid any confusion.
generics, &subtype, is_ref, is_mut, ptr_for_ref, true);
}
} else {
- let id = &&$p_arg.path.segments.iter().rev().next().unwrap().ident;
+ let id = subtype.rsplitn(2, ':').next().unwrap(); // Get the "Base" name of the resolved type
write!(w, "{}", id).unwrap();
write!(mangled_type, "{}", id).unwrap();
if let Some(w2) = $extra_write as Option<&mut Vec<u8>> {