Skip to content

windows::Error is not Send or Sync #600

Description

@qwandor

The windows::Error type is not Send or Sync. This means that a windows::Result<T> is not Send or Sync either, even if T is. This is a pain both for async code, and for integrating with common error-handling frameworks like eyre and anyhow. It is possible to work around both of these issues, but they make the API considerably less ergonomic.

It looks like the problem is that Error may contain a bindings::windows::win32::winrt::IRestrictedErrorInfo. It is not clear from the documentation whether this type is supposed to by thread-safe. Could it at least be made Send? That would help with the async issue, and then by wrapping it in a Mutex you could make windows::Error Sync as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions