mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
Add test for idents incl. raw idents
This commit is contained in:
parent
9cf99a9c71
commit
941416a1d6
2 changed files with 25 additions and 1 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
#![warn(rust_2018_idioms, unused_lifetimes, semicolon_in_expressions_from_macros)]
|
||||
|
||||
use proc_macro::{Group, Ident, Literal, Punct, TokenStream, TokenTree};
|
||||
use proc_macro::{Group, Ident, Literal, Punct, Span, TokenStream, TokenTree};
|
||||
|
||||
#[proc_macro]
|
||||
pub fn fn_like_noop(args: TokenStream) -> TokenStream {
|
||||
|
@ -40,6 +40,15 @@ pub fn fn_like_mk_literals(_args: TokenStream) -> TokenStream {
|
|||
TokenStream::from_iter(trees)
|
||||
}
|
||||
|
||||
#[proc_macro]
|
||||
pub fn fn_like_mk_idents(_args: TokenStream) -> TokenStream {
|
||||
let trees: Vec<TokenTree> = vec![
|
||||
TokenTree::from(Ident::new("standard", Span::call_site())),
|
||||
TokenTree::from(Ident::new_raw("raw", Span::call_site())),
|
||||
];
|
||||
TokenStream::from_iter(trees)
|
||||
}
|
||||
|
||||
#[proc_macro_attribute]
|
||||
pub fn attr_noop(_args: TokenStream, item: TokenStream) -> TokenStream {
|
||||
item
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue