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.
1 parent 6ba0ce4 commit f0fd9cdCopy full SHA for f0fd9cd
library/proc_macro/src/lib.rs
@@ -377,6 +377,21 @@ impl Extend<TokenStream> for TokenStream {
377
}
378
379
380
+macro_rules! extend_items {
381
+ ($($item:ident)*) => {
382
+ $(
383
+ #[stable(feature = "token_stream_extend_tt_items", since = "CURRENT_RUSTC_VERSION")]
384
+ impl Extend<$item> for TokenStream {
385
+ fn extend<T: IntoIterator<Item = $item>>(&mut self, iter: T) {
386
+ self.extend(iter.into_iter().map(|i| TokenTree::$item(i)));
387
+ }
388
389
+ )*
390
+ };
391
+}
392
+
393
+extend_items!(Group Literal Punct Ident);
394
395
/// Public implementation details for the `TokenStream` type, such as iterators.
396
#[stable(feature = "proc_macro_lib2", since = "1.29.0")]
397
pub mod token_stream {
0 commit comments