reading libstd::bool of rust

I am getting more and more curious about the language rust and today I read bool.rs

OK, this is how to import some of the names in a library.

use option::{None, Option, Some};

What is this cfg(not(test))? Looks like some pragmas for not testing something.

#[cfg(not(test))] use cmp::{Eq, Ord, TotalOrd, Ordering};

Now I find that these are called attributes. Maybe better than preprocessor magics. I also see #[test] and #[cfg(test)]. #[test] marks unit tests and #[cfg(…)] specifies when to build. (https://github.com/mozilla/rust/wiki/Doc-attributes) (https://github.com/mozilla/rust/wiki/Doc-unit-testing)

This one also.

impl ToStr for bool {
    #[inline]    // what is this inline symbol?  primitive?
    fn to_str(&self) -> ~str {
        if *self { ~"true" } else { ~"false" }
    }
}

What is this keyword “mod”? Wow, this is a module.

mod tests {

    use super::*;
    use prelude::*;

    #[test]
    fn test_bool_from_str() {
        do all_values |v| {
            assert!(Some(v) == FromStr::from_str(v.to_str()))
        }
    }