Skip to content

Commit

Permalink
Document Pu128.
Browse files Browse the repository at this point in the history
And move the `repr` line after the `derive` line, where it's harder to
overlook. (I overlooked it initially, and didn't understand how this
type worked.)
  • Loading branch information
nnethercote committed May 8, 2024
1 parent 55b6ff8 commit d7814e7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/rustc_data_structures/src/packed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
use std::cmp::Ordering;
use std::fmt;

#[repr(packed(8))]
/// A packed 128-bit integer. Useful for reducing the size of structures in
/// some cases.
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
#[repr(packed(8))]
pub struct Pu128(pub u128);

impl Pu128 {
Expand Down

0 comments on commit d7814e7

Please sign in to comment.