Skip to content

windows-core: Error handling for Free/Owned<T> #3682

@FeldrinH

Description

@FeldrinH

Suggestion

Most functions used to free handles can return errors and these errors are usually indicative of logic errors in the code. Unfortunately when using Owned<T> and/or Free there is no way to detect these errors.

It would be nice if Free::free() had some way to return errors. Even a basic Result<(), ()> to indicate the presence or absence of an error would be very useful.

As for Owned<T>, it would be nice if it had some kind of assertion to panic on error in drop, but this is a more risky proposal, since unexpected panics are quite destructive. Perhaps it could be a debug assertion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions