diff options
Diffstat (limited to 'tests/ui/proc-macro/auxiliary/negative-token.rs')
-rw-r--r-- | tests/ui/proc-macro/auxiliary/negative-token.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/proc-macro/auxiliary/negative-token.rs b/tests/ui/proc-macro/auxiliary/negative-token.rs new file mode 100644 index 000000000..8b89f2e37 --- /dev/null +++ b/tests/ui/proc-macro/auxiliary/negative-token.rs @@ -0,0 +1,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() +} |