aboutsummaryrefslogtreecommitdiff
path: root/crates/proc_macro_srv/src
diff options
context:
space:
mode:
authorKevin Mehall <[email protected]>2021-03-20 18:18:57 +0000
committerKevin Mehall <[email protected]>2021-03-20 18:28:44 +0000
commit0a0e22235b7ad222be1aaa7765b580f4096c9aeb (patch)
tree1742dd3512904541543f1b7a929cbc77cad14402 /crates/proc_macro_srv/src
parent5cc8ad0c4afda0c8b6222156b0c725cfb61892c0 (diff)
Make bare underscore token an Ident rather than Punct in proc-macro
Diffstat (limited to 'crates/proc_macro_srv/src')
-rw-r--r--crates/proc_macro_srv/src/rustc_server.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/crates/proc_macro_srv/src/rustc_server.rs b/crates/proc_macro_srv/src/rustc_server.rs
index ceefd187d..c147484c0 100644
--- a/crates/proc_macro_srv/src/rustc_server.rs
+++ b/crates/proc_macro_srv/src/rustc_server.rs
@@ -805,5 +805,14 @@ mod tests {
805 let t2 = TokenStream::from_str("(a);").unwrap(); 805 let t2 = TokenStream::from_str("(a);").unwrap();
806 assert_eq!(t2.token_trees.len(), 2); 806 assert_eq!(t2.token_trees.len(), 2);
807 assert_eq!(t2.token_trees[0], subtree_paren_a); 807 assert_eq!(t2.token_trees[0], subtree_paren_a);
808
809 let underscore = TokenStream::from_str("_").unwrap();
810 assert_eq!(
811 underscore.token_trees[0],
812 tt::TokenTree::Leaf(tt::Leaf::Ident(tt::Ident {
813 text: "_".into(),
814 id: tt::TokenId::unspecified(),
815 }))
816 );
808 } 817 }
809} 818}