Skip to content

Contradiction in documentation about alignment of AtomicBool #126084

Closed
@FeldrinH

Description

Location

https://doc.rust-lang.org/nightly/core/sync/atomic/struct.AtomicBool.html

Summary

The introductory section for AtomicBool states:

This type has the same size, alignment, and bit validity as a bool.

But later the safety requirements for from_ptr state:

ptr must be aligned to align_of::<AtomicBool>() (note that on some platforms this can be bigger than align_of::<bool>()).

This seems to be a contradiction. If AtomicBool has the same alignment as bool then how can align_of::<AtomicBool>() be bigger than align_of::<bool>().

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-bugCategory: This is a bug.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions