We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 76404c4 + 30402be commit 7f57a01Copy full SHA for 7f57a01
crates/hir_expand/src/builtin_macro.rs
@@ -182,25 +182,10 @@ fn assert_expand(
182
// ```,
183
// which is wrong but useful.
184
185
- let mut args = Vec::new();
186
- let mut current = Vec::new();
187
- for tt in tt.token_trees.iter().cloned() {
188
- match tt {
189
- tt::TokenTree::Leaf(tt::Leaf::Punct(p)) if p.char == ',' => {
190
- args.push(current);
191
- current = Vec::new();
192
- }
193
- _ => {
194
- current.push(tt);
195
196
197
198
- if !current.is_empty() {
199
200
+ let args = parse_exprs_with_sep(tt, ',');
201
202
let arg_tts = args.into_iter().flat_map(|arg| {
203
- quote! { &(##arg), }
+ quote! { &(#arg), }
204
}.token_trees).collect::<Vec<_>>();
205
206
let expanded = quote! {
0 commit comments