2018-02-22 01:09:53 -05:00
|
|
|
// macros2.rs
|
2017-03-17 10:30:29 -04:00
|
|
|
// Make me compile! Scroll down for hints :)
|
|
|
|
|
2019-11-11 07:38:24 -05:00
|
|
|
// I AM NOT DONE
|
|
|
|
|
2017-03-17 10:30:29 -04:00
|
|
|
fn main() {
|
|
|
|
my_macro!();
|
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! my_macro {
|
|
|
|
() => {
|
|
|
|
println!("Check out my macro!");
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-19 10:10:48 -04:00
|
|
|
// Macros don't quite play by the same rules as the rest of Rust, in terms of
|
|
|
|
// what's available where.
|
2017-03-17 10:30:29 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-19 10:10:48 -04:00
|
|
|
// Unlike other things in Rust, the order of "where you define a macro" versus
|
|
|
|
// "where you use it" actually matters.
|