External Publication
Visit Post

Could you borrow a bit?

Rust Internals [Unofficial] May 18, 2026
Source

bascule:

or does the layout of &bool prevent that

This you can work out yourself.

There are usize::MAX possible places a bool could be, because align_of::() == 1.

&bool is non-null, so it has exactly usize::MAX possible value.

Thus all possible values are accounted for and there's no space to add bit information.

(Plus we wouldn't do that anyway, for other reasons.)

Discussion in the ATmosphere

Loading comments...