pub fn encode_and_write_metadata(tcx: TyCtxt<'_>) -> (EncodedMetadata, bool)