Update documentation somewhat

This commit is contained in:
Thom Chiovoloni
2022-01-31 12:43:15 -08:00
parent e98c7f7209
commit a17a896d09
2 changed files with 26 additions and 12 deletions

View File

@@ -87,6 +87,16 @@ enum ErrorData<C> {
// higher already. We include it just because repr_bitpacked.rs's encoding
// requires an alignment >= 4 (note that `#[repr(align)]` will not reduce the
// alignment required by the struct, only increase it).
//
// If we add more variants to ErrorData, this can be increased to 8, but it
// should probably be behind `#[cfg_attr(target_pointer_width = "64", ...)]` or
// whatever cfg we're using to enable the `repr_bitpacked` code, since only the
// that version needs the alignment, and 8 is higher than the alignment we'll
// have on 32 bit platforms.
//
// (For the sake of being explicit: the alignment requirement here only matters
// if `error/repr_bitpacked.rs` is in use — for the unpacked repr it doesn't
// matter at all)
#[repr(align(4))]
pub(crate) struct SimpleMessage {
kind: ErrorKind,