We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 486fae1 + ff7081e commit 6967a85Copy full SHA for 6967a85
library/proc_macro/src/lib.rs
@@ -376,6 +376,21 @@ impl Extend<TokenStream> for TokenStream {
376
}
377
378
379
+macro_rules! extend_items {
380
+ ($($item:ident)*) => {
381
+ $(
382
+ #[stable(feature = "token_stream_extend_tt_items", since = "CURRENT_RUSTC_VERSION")]
383
+ impl Extend<$item> for TokenStream {
384
+ fn extend<T: IntoIterator<Item = $item>>(&mut self, iter: T) {
385
+ self.extend(iter.into_iter().map(TokenTree::$item));
386
+ }
387
388
+ )*
389
+ };
390
+}
391
+
392
+extend_items!(Group Literal Punct Ident);
393
394
/// Public implementation details for the `TokenStream` type, such as iterators.
395
#[stable(feature = "proc_macro_lib2", since = "1.29.0")]
396
pub mod token_stream {
0 commit comments