1
0
mirror of https://github.com/rust-lang/rustlings.git synced 2024-09-18 23:41:37 +02:00

macros2 solution

This commit is contained in:
mo8it 2024-07-01 11:31:37 +02:00
parent cf90364fd7
commit 9845e046de
2 changed files with 11 additions and 1 deletions

View File

@ -2,6 +2,7 @@ fn main() {
my_macro!();
}
// TODO: Fix the compiler error by moving the whole definition of this macro.
macro_rules! my_macro {
() => {
println!("Check out my macro!");

View File

@ -1 +1,10 @@
// Solutions will be available before the stable release. Thank you for testing the beta version 🥰
// Moved the macro definition to be before its call.
macro_rules! my_macro {
() => {
println!("Check out my macro!");
};
}
fn main() {
my_macro!();
}