Skip to content

Commit

Permalink
hidden fn main in doc test of def_usize_addr
Browse files Browse the repository at this point in the history
  • Loading branch information
aarkegz committed Aug 19, 2024
1 parent dc6956e commit 6545f85
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/addr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ impl<T> MemoryAddr for T where T: Copy + From<usize> + Into<usize> {}
/// pub type ExampleAddr;
/// }
///
/// fn main() {
/// const EXAMPLE: ExampleAddr = ExampleAddr::from_usize(0x1234);
/// const EXAMPLE_USIZE: usize = EXAMPLE.as_usize();
/// assert_eq!(EXAMPLE_USIZE, 0x1234);
/// assert_eq!(EXAMPLE.align_down(0x10usize), ExampleAddr::from_usize(0x1230));
/// assert_eq!(EXAMPLE.align_up_4k(), ExampleAddr::from_usize(0x2000));
/// }
/// # fn main() {
/// const EXAMPLE: ExampleAddr = ExampleAddr::from_usize(0x1234);
/// const EXAMPLE_USIZE: usize = EXAMPLE.as_usize();
/// assert_eq!(EXAMPLE_USIZE, 0x1234);
/// assert_eq!(EXAMPLE.align_down(0x10usize), ExampleAddr::from_usize(0x1230));
/// assert_eq!(EXAMPLE.align_up_4k(), ExampleAddr::from_usize(0x2000));
/// # }
/// ```
#[macro_export]
macro_rules! def_usize_addr {
Expand Down

0 comments on commit 6545f85

Please sign in to comment.