mirror of https://github.com/rust-lang/rust.git
20 lines
424 B
Rust
20 lines
424 B
Rust
extern crate proc_macro;
|
|
use proc_macro::TokenStream;
|
|
|
|
fn items() -> impl IntoIterator<Item = i32> {
|
|
vec![1, 2, 3]
|
|
}
|
|
|
|
#[macro_export]
|
|
macro_rules! quote {
|
|
// Rule for any other number of tokens.
|
|
($($tt:tt)*) => {{
|
|
fn items() -> impl IntoIterator<Item = i32> {
|
|
vec![1, 2, 3]
|
|
}
|
|
let _s = TokenStream::new();
|
|
let other_items = items().map(|i| i + 1);
|
|
_s
|
|
}};
|
|
}
|