summaryrefslogtreecommitdiffstats
path: root/tests/ui/proc-macro/auxiliary/negative-token.rs
blob: 8b89f2e373165259ec773b8e5f290f887023f996 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// force-host
// no-prefer-dynamic

#![crate_type = "proc-macro"]

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()
}