diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-05-06 15:36:46 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-05-09 08:13:24 +1000 |
| commit | d7814e72ebe3b4a293a5f91fa1648d2ef72639d3 (patch) | |
| tree | 6c15e33a9bbe8b20b3794cd66fa2b5d16b7c3f0b /compiler | |
| parent | 55b6ff8e41739404b0a6fb23e7f8fbff615a900d (diff) | |
| download | rust-d7814e72ebe3b4a293a5f91fa1648d2ef72639d3.tar.gz rust-d7814e72ebe3b4a293a5f91fa1648d2ef72639d3.zip | |
Document `Pu128`.
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.)
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_data_structures/src/packed.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_data_structures/src/packed.rs b/compiler/rustc_data_structures/src/packed.rs index b8d4b295dfa..0a392d91988 100644 --- a/compiler/rustc_data_structures/src/packed.rs +++ b/compiler/rustc_data_structures/src/packed.rs @@ -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 { |
