mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-19 19:17:31 +00:00
14 lines
307 B
Rust
14 lines
307 B
Rust
extern crate proc_macro;
|
|
|
|
use proc_macro::*;
|
|
|
|
#[proc_macro]
|
|
pub fn neg_one(_input: TokenStream) -> TokenStream {
|
|
TokenTree::Literal(Literal::i32_suffixed(-1)).into()
|
|
}
|
|
|
|
#[proc_macro]
|
|
pub fn neg_one_float(_input: TokenStream) -> TokenStream {
|
|
TokenTree::Literal(Literal::f32_suffixed(-1.0)).into()
|
|
}
|