Skip to content

Expose abort function from core #67952

Open
@m-ou-se

Description

@m-ou-se

It seems like core knows how to abort a program (it has core::intrinsics::abort), but only std exposes this functionality.

In some rare cases, a potentially unwinding panic might lead to unsoundness, where an abort would do a better job. A good example is the implementation of Arc.

The very same situation occurs in the atomic_refcell crate. As there is nothing else in the crate depending on std it should be a no_std crate. However, that change replaces the std exit/abort call with an ugly hack using a double-panic to try to cause an abort.

Instead, a stable abort function in core would be a lot nicer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-langRelevant to the language team, which will review and decide on the PR/issue.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.WG-embeddedWorking group: Embedded systems

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions