1
0
mirror of https://github.com/rust-lang/rustlings.git synced 2024-09-29 15:31:23 +02:00
rustlings/macros/macros2.rs

73 lines
445 B
Rust
Raw Normal View History

2017-03-17 15:30:29 +01:00
// Make me compile! Scroll down for hints :)
fn main() {
my_macro!();
}
macro_rules! my_macro {
() => {
println!("Check out my macro!");
};
}
2017-03-19 15:10:48 +01: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 15:30:29 +01:00
2017-03-19 15:10:48 +01:00
// Unlike other things in Rust, the order of "where you define a macro" versus
// "where you use it" actually matters.