Skip to content

Is there a way to use potentially panicking code in a #[no_panic] function #16

@KizzyCode

Description

@KizzyCode

While this sounds contra-intuitive, there are std/core-library functions where I can/have to assume that they are correct and won't panic (e.g. str::from_utf8). However since the compiler is unable to prove for some functions that they are panic-free, I cannot use them.

Is there a way to "trust" such a function that it will never panic? Since due to the huge amounts of unsafe code in std/core, I have to rely on their correctness anyway; so it would make no difference for my crate's correctness assumptions…

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions