Skip to content

Constants and interior mutability #5

Closed
@RalfJung

Description

@RalfJung

According to @oli-obk, there are currently some checks somewhere to rule out interior mutability in constants. However, this is accepted:

use std::sync::atomic::AtomicUsize;
const FOO : AtomicUsize = AtomicUsize::new(3);

It would be great if the reasons for this check could be spelled out, ideally somewhere in this repo :D

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