aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-02-14 12:36:21 +0100
committerPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-03-30 13:52:29 +0200
commit2e39012125d65cf22f53215c1aab70bbf8e3fd44 (patch)
tree48dfb8d896e3fc72b88c144261e1ddae4b6b5a82
parent553ffc74645b34a8b0a52bcd77a7499ca4f74d37 (diff)
downloadgcc-2e39012125d65cf22f53215c1aab70bbf8e3fd44.zip
gcc-2e39012125d65cf22f53215c1aab70bbf8e3fd44.tar.gz
gcc-2e39012125d65cf22f53215c1aab70bbf8e3fd44.tar.bz2
libproc_macro: Add iterator impl to TokenStream
Add iterator impl functions to the TokenStream rust interface in libproc_macro. ChangeLog: * librust/proc_macro/rust/lib.rs: Add iterators. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
-rw-r--r--librust/proc_macro/rust/lib.rs26
1 files changed, 25 insertions, 1 deletions
diff --git a/librust/proc_macro/rust/lib.rs b/librust/proc_macro/rust/lib.rs
index 2e91dd3..de2ad9d 100644
--- a/librust/proc_macro/rust/lib.rs
+++ b/librust/proc_macro/rust/lib.rs
@@ -4,7 +4,7 @@ pub use literal::Literal;
pub use punct::{Punct, Spacing};
pub use span::Span;
use std::error;
-use std::{fmt, str::FromStr};
+use std::{fmt, iter, str::FromStr};
mod group;
mod ident;
@@ -140,3 +140,27 @@ impl FromStr for TokenStream {
todo!("Implement this function")
}
}
+
+impl iter::FromIterator<TokenTree> for TokenStream {
+ fn from_iter<I: IntoIterator<Item = TokenTree>>(_trees: I) -> Self {
+ todo!("Implement this function")
+ }
+}
+
+impl iter::FromIterator<TokenStream> for TokenStream {
+ fn from_iter<I: IntoIterator<Item = TokenStream>>(_streams: I) -> Self {
+ todo!("Implement this function")
+ }
+}
+
+impl Extend<TokenTree> for TokenStream {
+ fn extend<I: IntoIterator<Item = TokenTree>>(&mut self, _trees: I) {
+ todo!("Implement this function")
+ }
+}
+
+impl Extend<TokenStream> for TokenStream {
+ fn extend<I: IntoIterator<Item = TokenStream>>(&mut self, _streams: I) {
+ todo!("Implement this function")
+ }
+}