mirror of
https://github.com/notohh/rustlings.git
synced 2024-11-22 14:02:22 -05:00
2cdd61294f
The `watch` command now requires user action to move to the next exercise. BREAKING CHANGE: this changes the behavior of `watch`.
75 lines
477 B
Rust
75 lines
477 B
Rust
// macros2.rs
|
|
// Make me compile! Scroll down for hints :)
|
|
|
|
// I AM NOT DONE
|
|
|
|
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.
|