1
0
Fork 0
mirror of https://github.com/rust-lang/rustlings.git synced 2024-05-25 17:36:11 +02:00
rustlings/old_curriculum/macros/macros2.rs
2018-04-26 21:29:11 +02:00

74 lines
459 B
Rust

// macros2.rs
// Make me compile! Scroll down for hints :)
fn main() {
my_macro!();
}
macro_rules! my_macro {
() => {
println!("Check out my macro!");
};
}
// Macros don't quite play by the same rules as the rest of Rust, in terms of
// what's available where.
// Unlike other things in Rust, the order of "where you define a macro" versus
// "where you use it" actually matters.