Skip to content

Commit 9a70c3a

Browse files
committed
Auto merge of #43280 - lfairy:token-tree-iter-clone, r=nrc
Add #[derive(Clone)] to TokenTreeIter I've found this useful for writing backtracking parsers. The underlying `Cursor` implements `Clone` already, so it's just a matter of adding `#[derive(Clone)]` to the type. r? @jseyfried
2 parents 6e0dc54 + b525abb commit 9a70c3a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/libproc_macro/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ impl Literal {
375375
}
376376

377377
/// An iterator over `TokenTree`s.
378+
#[derive(Clone)]
378379
#[unstable(feature = "proc_macro", issue = "38356")]
379380
pub struct TokenTreeIter {
380381
cursor: tokenstream::Cursor,

0 commit comments

Comments
 (0)