1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

//! # rustdoctest
//!
//! `rustdoctest` is a test ground for rustdoc

/// Does a lot of stuff
/// # Example
/// 
/// ```
/// assert_eq!( rustdoctest::i_panic(), Ok( 8 ) )
/// ```
///
/// # Panics
/// I panic there is nothing you can do
/// # Errors
/// No errors all is good
/// # Safety
/// Scoot is dangerous
pub fn i_panic() -> Result<u32, u32> {
    if false { panic!( "Hello World!!!!!" ); }
    println!( "Releasing SCOOT..." );
    Ok( 8 )
}

pub fn test() -> i32 {
    //! test function returns -74
    -74
}

pub use utils::mult;
pub use test_mod::*;

pub mod test_mod {

    pub use super::utils::mult;

    pub fn a() {
        println!( "a" );
    }

    pub fn b() {
        println!( "b" );
    }

}

pub mod utils {

    pub fn mult( a: i32, b: i32 ) -> i32 {
        a * b
    }

}