pub fn ptrauth_clone_discriminated_schema_for<'tcx, S>(
tcx: TyCtxt<'tcx>,
schema: Option<PointerAuthSchema>,
source: S,
) -> Option<PointerAuthSchema>where
S: FnPtrDiscriminatorSource<'tcx>,Expand description
Clones a pointer authentication schema and updates its constant discriminator.
If schema is Some, the function computes a function pointer type
discriminator from source and stores it in the cloned schema’s
constant_discriminator field.
If no discriminator can be computed (for example, because source does not
represent a function pointer type), the schema is returned unchanged.
This is intended as a convenience helper for code generation sites that need
to attach function pointer type discrimination to a generic schema before
calling get_fn_addr.