fix: make macOS keychain duplicate detection compile (E0521)

Give the platform error a 'static trait-object lifetime so downcast_ref to security_framework::base::Error is legal; the macOS cfg block previously failed to compile on Apple targets.
This commit is contained in:
Matt
2026-08-13 01:08:26 +00:00
parent 039ac6f9d3
commit ff3cd10b60
+1 -1
View File
@@ -156,7 +156,7 @@ pub fn describe_error(err: &keyring::Error) -> String {
/// True when a platform error is the macOS `errSecDuplicateItem` code, which
/// the login keychain reports when an add hits an item that already exists.
fn is_duplicate_item(err: &(dyn std::error::Error + Send + Sync)) -> bool {
fn is_duplicate_item(err: &(dyn std::error::Error + Send + Sync + 'static)) -> bool {
#[cfg(target_os = "macos")]
{
if let Some(sec_err) = err.downcast_ref::<security_framework::base::Error>() {