about summary refs log tree commit diff
path: root/tests/ui/proc-macro/auxiliary/negative-token.rs
blob: d3731c1c8cc4d90828078b78009acf53504e95c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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()
}