1
0
mirror of https://github.com/rust-lang/rustlings.git synced 2025-06-19 00:17:42 +02:00
Files
exercises
enums
error_handling
functions
if
macros
README.md
macros1.rs
macros2.rs
macros3.rs
macros4.rs
modules
move_semantics
primitive_types
standard_library_types
strings
structs
tests
threads
variables
test1.rs
test2.rs
test3.rs
test4.rs
src
tests
.clog.toml
.gitignore
.travis.yml
CHANGELOG.md
CONTRIBUTING.md
Cargo.lock
Cargo.toml
LICENSE
README.md
default_out.txt
info.toml
install.ps1
install.sh
rustlings/exercises/macros/macros1.rs

65 lines
387 B
Rust
Raw Normal View History

2018-02-21 22:09:53 -08:00
// macros1.rs
2017-03-17 09:30:29 -05:00
// Make me compile! Scroll down for hints :)
macro_rules! my_macro {
() => {
println!("Check out my macro!");
};
}
fn main() {
my_macro();
}
2017-03-19 10:10:48 -04:00
// When you call a macro, you need to add something special compared to a
// regular function call. If you're stuck, take a look at what's inside
// `my_macro`.