Skip to content

Commit d7814e7

Browse files
committed
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.)
1 parent 55b6ff8 commit d7814e7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/rustc_data_structures/src/packed.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
33
use std::cmp::Ordering;
44
use std::fmt;
55

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

1012
impl Pu128 {

0 commit comments

Comments
 (0)