From f14f3115d488d3b2800d00c14916d52fc36bbbbf Mon Sep 17 00:00:00 2001 From: Marc-Andre Lureau Date: Wed, 29 Jan 2025 02:10:41 +0400 Subject: [PATCH] fix(connector): make LicenseCache RefUnwindSafe (#653) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes commit dd221bf ("feat: support license caching (#634)") and semver-checks is now happy: type ProcessorOutput is no longer UnwindSafe, in /tmp/.tmppi9kAf/IronRDP/crates/ironrdp-session/src/x224/mod.rs:15 Signed-off-by: Marc-André Lureau Changelog: ignore --- crates/ironrdp-connector/src/license_exchange.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/ironrdp-connector/src/license_exchange.rs b/crates/ironrdp-connector/src/license_exchange.rs index 28b60bfe..fe18a2d2 100644 --- a/crates/ironrdp-connector/src/license_exchange.rs +++ b/crates/ironrdp-connector/src/license_exchange.rs @@ -1,6 +1,7 @@ use super::{legacy, ConnectorError, ConnectorErrorExt}; use crate::{encode_send_data_request, ConnectorResult, ConnectorResultExt as _, Sequence, State, Written}; use core::fmt::Debug; +use core::panic::RefUnwindSafe; use core::{fmt, mem}; use ironrdp_core::WriteBuf; use ironrdp_pdu::rdp::server_license::{self, LicenseInformation, LicensePdu, ServerLicenseError}; @@ -62,7 +63,8 @@ pub struct LicenseExchangeSequence { pub license_cache: Arc, } -pub trait LicenseCache: Sync + Send + Debug { +// Use RefUnwindSafe so that types that embed LicenseCache remain UnwindSafe +pub trait LicenseCache: Sync + Send + Debug + RefUnwindSafe { fn get_license(&self, license_info: LicenseInformation) -> ConnectorResult>>; fn store_license(&self, license_info: LicenseInformation) -> ConnectorResult<()>; }