Skip to content

Put an UnsafeCell on the static mut context #820

Open
@apoelstra

Description

@apoelstra

It is probably UB to assign to this object without an unsafecell around it. Unless we are going to remove it entirely before the next release, we should stick an UnsafeCell around it.

Even if we do drop this before the next release, if we have a small enough patch we might wanna backport it. Though there haven't been any user reports of visible problems.

May also be worth filing a clippy issue to lint any direct assignments to Drop static muts.

Based on post by @Kixunil in #794 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions